MCPcopy
hub / github.com/codeaashu/claude-code / BackgroundHint

Function BackgroundHint

src/tools/BashTool/UI.tsx:31–84  ·  view source on GitHub ↗
(t0)

Source from the content-addressed store, hash-verified

29// Simple component to show background hint and handle ctrl+b
30// When ctrl+b is pressed, backgrounds ALL running foreground commands
31export function BackgroundHint(t0) {
32 const $ = _c(9);
33 let t1;
34 if ($[0] !== t0) {
35 t1 = t0 === undefined ? {} : t0;
36 $[0] = t0;
37 $[1] = t1;
38 } else {
39 t1 = $[1];
40 }
41 const {
42 onBackground
43 } = t1;
44 const store = useAppStateStore();
45 const setAppState = useSetAppState();
46 let t2;
47 if ($[2] !== onBackground || $[3] !== setAppState || $[4] !== store) {
48 t2 = () => {
49 backgroundAll(() => store.getState(), setAppState);
50 onBackground?.();
51 };
52 $[2] = onBackground;
53 $[3] = setAppState;
54 $[4] = store;
55 $[5] = t2;
56 } else {
57 t2 = $[5];
58 }
59 const handleBackground = t2;
60 let t3;
61 if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
62 t3 = {
63 context: "Task"
64 };
65 $[6] = t3;
66 } else {
67 t3 = $[6];
68 }
69 useKeybinding("task:background", handleBackground, t3);
70 const baseShortcut = useShortcutDisplay("task:background", "Task", "ctrl+b");
71 const shortcut = env.terminal === "tmux" && baseShortcut === "ctrl+b" ? "ctrl+b ctrl+b (twice)" : baseShortcut;
72 if (isEnvTruthy(process.env.CLAUDE_CODE_DISABLE_BACKGROUND_TASKS)) {
73 return null;
74 }
75 let t4;
76 if ($[7] !== shortcut) {
77 t4 = <Box paddingLeft={5}><Text dimColor={true}><KeyboardShortcutHint shortcut={shortcut} action="run in background" parens={true} /></Text></Box>;
78 $[7] = shortcut;
79 $[8] = t4;
80 } else {
81 t4 = $[8];
82 }
83 return t4;
84}
85export function renderToolUseMessage(input: Partial<BashToolInput>, {
86 verbose,
87 theme: _theme

Callers

nothing calls this directly

Calls 6

useAppStateStoreFunction · 0.85
useSetAppStateFunction · 0.85
backgroundAllFunction · 0.85
useKeybindingFunction · 0.85
useShortcutDisplayFunction · 0.85
isEnvTruthyFunction · 0.85

Tested by

no test coverage detected