One way to tell whether a terminal is a scrolling screen or a tool that understands your commands is to look for shell integration.
At its core, shell integration lets the shell report structured information to the terminal between commands using OSC escape sequences: the current directory, where a command starts and ends, and its exit code. The terminal goes from displaying characters to understanding what happened.
What the shell reports determines what the terminal can do
This round of shell integration work in Docklark covers several everyday tasks:
- Show the current directory and exit code for each command, making success or failure visible at a glance.
- Jump between previous and next commands rather than scanning long logs by eye.
- Select the most recent command’s output without carefully dragging a selection.
- Open the terminal’s current directory in SFTP after confirming that the terminal and SFTP hosts match.
That last point deserves emphasis. The host shown in the terminal and the one connected to the file panel are not necessarily the same. Jump hosts and nested SSH can cause a mismatch, so the client needs confirmation before opening the directory rather than assuming they match.
Why Zsh is automatic and Bash is manual
Zsh provides hooks such as precmd and preexec, giving the integration script a clear place to run. Docklark therefore enables it automatically for local Zsh.
Bash relies on composing PROMPT_COMMAND, a variable many experienced users have already customized. Automatically injecting into it can conflict with existing prompt logic. Breaking someone else’s prompt is an unwelcome surprise. Bash sessions, and Zsh sessions where automatic injection is unwanted, therefore retain a manual option: one command that applies only to the current session.
OSC 52: useful enough to support, sensitive enough to disable by default
OSC 52 lets remote programs use escape sequences to read or write the local clipboard. Copying content this way is convenient: output from a file on the server can be sent directly to the local clipboard.
The reverse direction matters too. A remote program may request clipboard contents that include a password, a key, or an internal link.
Docklark therefore separates OSC 52 writes and reads into independent controls, both disabled by default. Writing can be enabled separately. Reading remains off by default and requires a separate confirmation for every read. I would rather require another confirmation than let a remote program quietly take clipboard contents.
Details that needed care
- Prompt redraw and scrollback reflow need separate handling; otherwise, resizing a window can misalign an unsubmitted command draft.
- Dragging a file into a local terminal inserts a shell-quoted path without executing it. Turning a drop directly into a command is a familiar terminal pitfall.
- Bells in background sessions need a separate indicator so you can see which tab needs attention before switching to it.
These details seem small individually, but they add up in a terminal used for hours every day. Docklark’s full feature list and release status are on the project page.