Terminal¶
There is a terminal panel at the bottom of the screen.
Opening and closing¶
| Method | Action |
|---|---|
Ctrl+` |
Toggle the panel |
Ctrl+J |
Toggle the panel (only when the terminal does not have focus) |
Space t (Helix mode) |
Toggle the panel |
:sh <command> |
Open the terminal and run the command |
What runs inside¶
- A login shell (
$SHELL -l) runs on a PTY. It reads.zshrcand so on. - Full-screen programs such as
vim,topandlazygitwork too. - Scroll the mouse wheel to go back through past output.
Keys¶
When the terminal has focus, most keys are passed to the shell. The keys that shijimi handles are:
| Key | Action |
|---|---|
Ctrl+Q |
Quit shijimi |
Ctrl+` |
Close the terminal |
Alt+R |
Resize mode (Understanding the screen) |
F1 |
Command palette |
There is one terminal. For several, use a multiplexer such as herdr or tmux. When the shell exits, the panel closes, and the next time you open it a new shell starts.
Copying¶
Selecting with the mouse¶
Drag with the left mouse button inside the terminal to select the characters in that range. When you release the button, the selected characters go to the clipboard.
- While a program that uses the mouse (
vim,htop, tmux and so on) is running, drag while holdingShift. - If you drag the pointer above or below the terminal, you can go back through past output while selecting.
- Pressing a key or clicking inside the terminal clears the selection.
Copying from a program¶
When a program in the terminal (Claude Code, tmux and so on) copies with OSC 52, the text goes to shijimi's clipboard.
- When a copy happens, the status bar shows "Copied N characters from the terminal".
- It is also sent to the outer terminal with OSC 52. Even over SSH, it reaches the clipboard on your local machine (if the outer terminal supports OSC 52).
- Copies larger than about 1.5 MB are not accepted. An error appears in the status bar.
Inside a terminal multiplexer¶
When shijimi runs in a terminal multiplexer, [experimental] multiplexer is true (Configuration files) and the multiplexer is supported, the terminal commands use a pane of the multiplexer instead of the terminal panel. The multiplexer then detects the state of the agents run there, notifies you and restores them. Which multiplexer is used is set by [terminal] multiplexer ("auto" by default, which takes the innermost multiplexer among the parent processes of shijimi; "none" always uses the terminal panel). herdr (HERDR_ENV=1) , tmux 3.1 or later (TMUX set) and zellij 0.44 or later (ZELLIJ set) and cmux on macOS (CMUX_WORKSPACE_ID and CMUX_SURFACE_ID set) are supported. Without a supported multiplexer, or with multiplexer = false or "none", nothing changes. The rest of this section describes herdr, tmux, zellij and cmux; they work the same way except where noted.
| Method | Action |
|---|---|
Ctrl+` / Space t / :sh |
The first time, create a pane right below shijimi's pane and move focus there. After that, hide the pane, or show it again (and move focus there) |
Ctrl+J |
Show the pane and move focus there |
:sh <command> |
Show the pane and run the command in it |
Space a / Alt+A |
Paste the context into the pane (Enter is not sent) |
shj exec ":sh hide" |
Hide the pane. Run it in the pane; bind it to a key of the multiplexer |
- The pane is hidden by zooming shijimi's pane (in tmux,
resize-pane -Z; in zellij,toggle-fullscreen). cmux has no zoom: hiding only moves the focus back to shijimi, and the pane stays on the screen. In cmux the command that starts the pane's shell is typed into it (cd <root> && exec env ...), so it is visible. The new pane takes 30% of the height; in zellij and cmux, which cannot size a tiled pane, half of it. zellij names the pane by--pane-idin every action, so nothing depends on the focus. In tmux, a pane that ended but is kept byremain-on-exitcounts as ended, and a new one is created. - The pane starts in the root of the workspace, with the same environment variables as the terminal panel, so
claudestarted there connects to the IDE integration. - To end the pane, type
exitin its shell or use the multiplexer's key (herdr:Ctrl+B x; tmux: its prefix thenx; zellij:Ctrl+Pthenx; cmux: close the surface with its own key). After that, the nextCtrl+`creates a new pane. When shijimi quits, it closes the pane it created. - To go back to shijimi from the pane, use the multiplexer's key (herdr:
Ctrl+Bkby default; tmux: its prefix then an arrow key, orselect-pane -U; zellij:Alt+Upby default; cmux: its keys for moving between panes). shijimi's own keys (Ctrl+Q,Ctrl+`,Alt+RandF1) do not work in the pane. - The screen, the scrolling, the copying with the mouse and OSC 52 in the pane are the multiplexer's. The message "Copied N characters from the terminal" does not appear.
- The shell of the pane reports the exit code of each command with
shj command-end <code>, so the suggestion to investigate a failed command still appears. This works for zsh and bash. For bash, the hook is set throughPROMPT_COMMAND, so it does not work when a startup file replacesPROMPT_COMMAND. - When a command of the multiplexer fails, the error is shown in the status bar.
Environment variables¶
SHIJIMI_SOCKET is set in the shell of the terminal panel.
You can use it to control shijimi from the shell.
When it is not set, shj looks for the running shijimi by itself (see AI agent integration).
CLAUDE_CODE_SSE_PORT, ENABLE_IDE_INTEGRATION=true and FORCE_CODE_TERMINAL=true are also set, for the Claude Code IDE integration.
For details, see AI agent integration.