Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

feat: add shell Ctrl+B control

[._.]/ Adam Eivycd70854e084b
diff --git a/client/src/components/shell/TerminalHotKeys.jsx b/client/src/components/shell/TerminalHotKeys.jsx
index 10d0cd7295..2dc95cb4c9 100644
--- a/client/src/components/shell/TerminalHotKeys.jsx
+++ b/client/src/components/shell/TerminalHotKeys.jsx
@@ -1,4 +1,4 @@
-import { OctagonX, ClipboardPaste, ArrowUp, ArrowDown, ArrowLeft, ArrowRight, CornerDownLeft } from 'lucide-react';
+import { OctagonX, ChevronsLeft, ClipboardPaste, ArrowUp, ArrowDown, ArrowLeft, ArrowRight, CornerDownLeft } from 'lucide-react';
// Hot buttons for arrow / Enter entry — handy on touch devices and for driving TUI
// apps or scrolling shell history without a hardware keyboard. Arrow keys carry the
@@ -15,12 +15,21 @@ export const NAV_KEYS = [
];
// Touch-friendly TUI-driving controls shared by the inline quick-commands toolbar
-// and the fullscreen control bar: Ctrl+C, Paste (+ fallback paste input), and the
-// arrow / Enter hot buttons. The Ctrl+C / Paste text labels collapse below `sm` so
+// and the fullscreen control bar: Ctrl+B/C, Paste (+ fallback paste input), and the
+// arrow / Enter hot buttons. The Ctrl+B/C / Paste text labels collapse below `sm` so
// the cluster stays narrow on a phone; the icons always show.
-export default function TerminalHotKeys({ sendCtrlC, handlePaste, sendNavKey, showPasteInput, setShowPasteInput, pasteInputRef, handlePasteInputEvent }) {
+export default function TerminalHotKeys({ sendCtrlB, sendCtrlC, handlePaste, sendNavKey, showPasteInput, setShowPasteInput, pasteInputRef, handlePasteInputEvent }) {
return (
<>
+ <button
+ onClick={sendCtrlB}
+ className="flex items-center gap-1.5 px-3 py-1.5 bg-port-card hover:bg-port-border text-gray-300 hover:text-white rounded text-xs font-mono transition-colors border border-port-border min-h-[40px] shrink-0"
+ title="Send Ctrl+B"
+ aria-label="Send Ctrl+B"
+ >
+ <ChevronsLeft size={14} />
+ <span className="hidden sm:inline">Ctrl+B</span>
+ </button>
<button
onClick={sendCtrlC}
className="flex items-center gap-1.5 px-3 py-1.5 bg-port-error/15 hover:bg-port-error/25 text-port-error hover:text-port-error/80 rounded text-xs font-mono transition-colors border border-port-error/30 min-h-[40px] shrink-0"
diff --git a/client/src/hooks/useShellSession.js b/client/src/hooks/useShellSession.js
index d5d2449833..da2cd2bd55 100644
--- a/client/src/hooks/useShellSession.js
+++ b/client/src/hooks/useShellSession.js
@@ -153,6 +153,7 @@ export function useShellSession({ isFullscreen } = {}) {
}, [socket]);
const sendCommand = useCallback((cmd) => emitShellInput(cmd + '\n'), [emitShellInput]);
+ const sendCtrlB = useCallback(() => emitShellInput('\x02'), [emitShellInput]);
const sendCtrlC = useCallback(() => emitShellInput('\x03'), [emitShellInput]);
// Arrow keys send CSI or SS3 based on the terminal's DECCKM state (see NAV_KEYS);
// Enter and any other literal-`seq` keys pass through unchanged. focus:false keeps the
@@ -790,6 +791,7 @@ export function useShellSession({ isFullscreen } = {}) {
isLiveRun,
emitShellInput,
sendCommand,
+ sendCtrlB,
sendCtrlC,
sendNavKey,
restartSession,
diff --git a/client/src/hooks/useShellSession.test.jsx b/client/src/hooks/useShellSession.test.jsx
index 5c4229127a..bda79ab923 100644
--- a/client/src/hooks/useShellSession.test.jsx
+++ b/client/src/hooks/useShellSession.test.jsx
@@ -57,6 +57,14 @@ describe('useShellSession', () => {
expect(result.current.connected).toBe(true);
});
+ it('sends Ctrl+B to the active terminal session', () => {
+ const { result } = renderHook(() => useShellSession({}), { wrapper });
+ fire('shell:sessions', []);
+ fire('shell:started', { sessionId: 'abc' });
+ act(() => result.current.sendCtrlB());
+ expect(lastEmit('shell:input')).toEqual(['shell:input', { sessionId: 'abc', data: '\x02' }]);
+ });
+
it('ignores a shell:attached whose id does not match the pending target (strict-equality guard)', () => {
const { result } = renderHook(() => useShellSession({}), { wrapper });
// First load with one free survivor → auto-attach to s1 (claim:true), pending target 's1'.
diff --git a/client/src/pages/Shell.jsx b/client/src/pages/Shell.jsx
index 3de9470ad8..c1f8da8a7d 100644
--- a/client/src/pages/Shell.jsx
+++ b/client/src/pages/Shell.jsx
@@ -41,6 +41,7 @@ export default function Shell() {
isLiveRun,
emitShellInput,
sendCommand,
+ sendCtrlB,
sendCtrlC,
sendNavKey,
restartSession,
@@ -183,6 +184,7 @@ export default function Shell() {
{!isFullscreen && connected && (
<div className="flex items-center gap-2 mb-3 flex-wrap">
<TerminalHotKeys
+ sendCtrlB={sendCtrlB}
sendCtrlC={sendCtrlC}
handlePaste={handlePaste}
sendNavKey={sendNavKey}
@@ -261,6 +263,7 @@ export default function Shell() {
<div className="w-px h-6 bg-port-border shrink-0" />
{connected && (
<TerminalHotKeys
+ sendCtrlB={sendCtrlB}
sendCtrlC={sendCtrlC}
handlePaste={handlePaste}
sendNavKey={sendNavKey}