Five issues + keyboard shortcuts across booterm and the workspace shell. Auto-switch on create (mobile): addSplitPane now returns the new pane id; Session.tsx wraps it with addPaneAndSwitch which pushes ?pane=<newId> on mobile so the URL-sync effect doesn't fight the just-set activePaneIdx. NewPaneMenu uses the wrapper; desktop Split dropdown is unaffected. Tab-away reconnect: TerminalPane has a connect()/manualReconnect() state machine. ws.onclose backs off 500ms/1s/2s × 3 attempts, then surfaces a [Disconnected] banner with a Reconnect button. visibilitychange listener calls manualReconnect when the tab returns and the WS isn't OPEN. tmux session persists server-side so scrollback is intact on resume. Copy/paste: attachCustomKeyEventHandler binds Cmd/Ctrl-C (copy if selection, else send ^C), Cmd/Ctrl-Shift-C (always swallow — copy if any, no-op otherwise — never sends ^C), Cmd/Ctrl-V and Cmd/Ctrl-Shift-V (navigator.clipboard.readText → ws.send). No custom right-click menu — browser's native menu is preserved. Scroll: removed `set -g mouse on` from tmux.conf so xterm.js sees wheel and touch events natively. scrollback: 10_000, fastScrollModifier: 'shift', altClickMovesCursor: false. Container has touch-action: pan-y for mobile. Right-edge gap: inline <style> overrides xterm's defaults to width:100% height:100% and hides the scrollbar chrome. Host container is flex-1 min-w-0 self-stretch w-full. Three refit triggers: ResizeObserver (rAF-wrapped), document.fonts.ready, and useEffect on the new active prop. Background color matched between outer div, inner div, and xterm theme. Keyboard shortcuts in Session.tsx (window-level keydown): Cmd/Ctrl+` focus active terminal, else jump to last Cmd/Ctrl+Shift+T new terminal pane Cmd/Ctrl+Shift+C new chat pane (defers to xterm copy if focused) Cmd/Ctrl+W close active pane Cmd/Ctrl+Tab/Shift+Tab cycle next / prev pane Cmd/Ctrl+1..9 jump to pane N terminalsRegistry gains a focus() callback per registration so Cmd+` can call term.focus() on the active terminal. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
21 lines
1.1 KiB
Bash
21 lines
1.1 KiB
Bash
set -g default-terminal "screen-256color"
|
|
set -g history-limit 50000
|
|
# v1.10.3: `set -g mouse on` removed. tmux's mouse mode captured wheel/touch
|
|
# events at the protocol level, so xterm.js never saw them and the viewport
|
|
# couldn't scroll on mobile. With mouse off, xterm.js handles scrollback
|
|
# natively (wheel on desktop, finger-drag on mobile via touch-action: pan-y).
|
|
# Tradeoff: lose tmux mouse pane-resize and scroll-inside-vim; acceptable for
|
|
# the homelab single-user setup.
|
|
setw -g mode-keys vi
|
|
set -g status off
|
|
set -g destroy-unattached off
|
|
|
|
# v1.10.1: shells drop privs to samkintop (uid 1000) so the terminal runs in
|
|
# the user's environment, not root. `env HOME=… USER=…` is required because
|
|
# gosu (and su-exec before it) only changes uid/gid — it leaves env intact,
|
|
# and the tmux server runs as root so HOME would otherwise be /root. bash -l
|
|
# then sources samkintop's ~/.profile / ~/.bashrc to pick up PATH (nvm,
|
|
# ~/.local/bin, ~/.opencode/bin).
|
|
# v1.10.2: su-exec → gosu (alpine → debian; functionally identical).
|
|
set -g default-command "gosu samkintop:samkintop env HOME=/home/samkintop USER=samkintop SHELL=/bin/bash bash -l"
|