Repository navigation
Shell Integration
Shells can mark where prompts, commands and command output start with OSC 133 escape sequences. With these marks, tron can:
- Jump between prompts:
Ctrl+Shift+Z(previous) andCtrl+Shift+X(next),Cmd+UpandCmd+Downon macOS. - Select the output of the last command with
Ctrl+Shift+G(Cmd+Shift+Upon macOS). After jumping to a prompt, it selects the output of the command at the top of the view instead. - Copy that output with the
copy_command_outputaction; see Key Bindings. - Let the shell redraw its prompt when the window is resized, instead of leaving broken prompt lines behind.
fish 4 sends the marks by itself. Nothing to set up.
Add to ~/.bashrc, after anything else that sets PS1:
PS0='\e]133;C\e\\'
PS1='\[\e]133;D\e\\\e]133;A\e\\\]'"$PS1"'\[\e]133;B\e\\\]'Add to ~/.zshrc:
precmd() { print -n '\e]133;D\e\\\e]133;A\e\\' }
preexec() { print -n '\e]133;C\e\\' }If a framework such as oh-my-zsh already defines precmd or preexec, add
the functions to the hook arrays instead:
_tron_precmd() { print -n '\e]133;D\e\\\e]133;A\e\\' }
_tron_preexec() { print -n '\e]133;C\e\\' }
precmd_functions+=(_tron_precmd)
preexec_functions+=(_tron_preexec)| Sequence | Meaning |
|---|---|
OSC 133 ; A ST |
A prompt starts |
OSC 133 ; B ST |
The prompt ends, the command line starts |
OSC 133 ; C ST |
The command runs, its output starts |
OSC 133 ; D ST |
The command finished |
Shells that report their directory with OSC 7 let New Window
(Ctrl+Shift+N) open in the same directory. fish and many distribution
configurations of bash and zsh (through vte.sh) send it already.
Programs running in tron see:
| Variable | Value |
|---|---|
TERM |
xterm-tron, or the term setting under [shell]
|
COLORTERM |
truecolor |
TERM_PROGRAM |
tron |
TERM_PROGRAM_VERSION |
tron's version |
KITTY_WINDOW_ID |
1, so tools that check for kitty use the kitty graphics protocol |
Variables from a tmux session or another terminal that tron was started from,
such as TMUX, KITTY_PID or WEZTERM_PANE, are removed so programs do not
think they run inside those.
Using tron
Looks
Features
Reference