feat(cli): suppress shell inactivity indicators when cursor is hidden

This commit is contained in:
Keith Guerin
2026-03-27 20:59:00 -07:00
parent 5a39e69164
commit bc17679db7
7 changed files with 58 additions and 6 deletions
@@ -242,7 +242,12 @@ export const useShellCommandProcessor = (
// Subscribe to future updates (data only)
const dataUnsubscribe = ShellExecutionService.subscribe(pid, (event) => {
if (event.type === 'data') {
dispatch({ type: 'APPEND_SHELL_OUTPUT', pid, chunk: event.chunk });
dispatch({
type: 'APPEND_SHELL_OUTPUT',
pid,
chunk: event.chunk,
isCursorHidden: event.isCursorHidden,
});
} else if (event.type === 'binary_detected') {
dispatch({ type: 'UPDATE_SHELL', pid, update: { isBinary: true } });
} else if (event.type === 'binary_progress') {
@@ -381,6 +386,8 @@ export const useShellCommandProcessor = (
pid: executionPid,
chunk:
event.type === 'data' ? event.chunk : cumulativeStdout,
isCursorHidden:
event.type === 'data' ? event.isCursorHidden : undefined,
});
return;
}
@@ -396,7 +403,12 @@ export const useShellCommandProcessor = (
}
if (shouldUpdate) {
dispatch({ type: 'SET_OUTPUT_TIME', time: Date.now() });
dispatch({
type: 'SET_OUTPUT_TIME',
time: Date.now(),
isCursorHidden:
event.type === 'data' ? event.isCursorHidden : undefined,
});
setPendingHistoryItem((prevItem) => {
if (prevItem?.type === 'tool_group') {
return {
@@ -550,5 +562,6 @@ export const useShellCommandProcessor = (
registerBackgroundShell,
dismissBackgroundShell,
backgroundShells: state.backgroundShells,
isCursorHidden: state.isCursorHidden,
};
};