π Lock your terminal. Unlock with your fingerprint.
A terminal lock screen for macOS that uses Touch ID for biometric unlock with macOS password fallback. Drop it into tmux as your lock-command and walk away.
Screensaver
Passphrase
Touch ID
β¨ Features
ποΈ Touch ID fingerprint unlock via macOS LocalAuthentication
π macOS password fallback with blinking block cursor
π§ Auto-detects Touch ID availability (skips when lid is closed)
π‘οΈ Signal-proof β Ctrl+C, Ctrl+Z won't bypass the lock
π Terminal resize aware
π₯οΈ Designed as a tmuxlock-command
π¦ Install
Note: tlock requires CGo and macOS frameworks (LocalAuthentication, PAM),
so it must be built from source on a Mac.
git clone https://github.com/retr0h/tlock.git
cd tlock
go build -o tlock .
sudo mv tlock /usr/local/bin/
π Usage
Run directly:
tlock # Password prompt only
tlock --snake # Worms immediately
tlock --screensaver # Worms after 30s idle (default delay)
tlock --screensaver --screensaver-delay 60 # Worms after 1 min idle
As a tmux lock command:
# ~/.tmux.conf
set -g lock-command "tlock --snake"
set -g lock-after-time 1800 # Lock after 30 min idle
bind ^X lock-server # Ctrl+X to lock now
βοΈ How It Works
Terminal locks and shows the passphrase prompt with a blinking cursor
Type your macOS password and press Enter to unlock
Press Esc to switch to Touch ID β authenticate with your fingerprint
Wrong password? ACCESS DENIED β back to the prompt. Try again.
All signals (SIGINT, SIGTERM, SIGTSTP) are ignored. The only way out is authentication. π
π Requirements
π macOS (uses LocalAuthentication.framework and PAM)
πΉ Go 1.21+ with CGo enabled
ποΈ Touch ID hardware (optional β password fallback always available)
π‘ Inspiration
tlock is inspired by xlock, the classic X11 screen locker from the 90s that shipped with most Unix workstations. The worm screensaver mode (xlock -mode worm) by David Bagley was a staple of SGI Indigos and Sun workstations in dimly lit server rooms everywhere.