Fix bug where users are unable to re-enter disconnected terminals. (#8765)

This commit is contained in:
Jacob Richman
2025-09-20 10:59:37 -07:00
committed by GitHub
parent 2216856e3c
commit 375b8522fc
15 changed files with 267 additions and 55 deletions

View File

@@ -86,7 +86,7 @@ import { useWorkspaceMigration } from './hooks/useWorkspaceMigration.js';
import { useSessionStats } from './contexts/SessionContext.js';
import { useGitBranchName } from './hooks/useGitBranchName.js';
import { useExtensionUpdates } from './hooks/useExtensionUpdates.js';
import { FocusContext } from './contexts/FocusContext.js';
import { ShellFocusContext } from './contexts/ShellFocusContext.js';
const CTRL_EXIT_PROMPT_DURATION_MS = 1000;
@@ -135,7 +135,7 @@ export const AppContainer = (props: AppContainerProps) => {
initializationResult.themeError,
);
const [isProcessing, setIsProcessing] = useState<boolean>(false);
const [shellFocused, setShellFocused] = useState(false);
const [embeddedShellFocused, setEmbeddedShellFocused] = useState(false);
const [geminiMdFileCount, setGeminiMdFileCount] = useState<number>(
initializationResult.geminiMdFileCount,
@@ -557,10 +557,10 @@ Logging in with Google... Please restart Gemini CLI to continue.
setModelSwitchedFromQuotaError,
refreshStatic,
() => cancelHandlerRef.current(),
setShellFocused,
setEmbeddedShellFocused,
terminalWidth,
terminalHeight,
shellFocused,
embeddedShellFocused,
);
// Auto-accept indicator
@@ -917,8 +917,8 @@ Logging in with Google... Please restart Gemini CLI to continue.
) {
setConstrainHeight(false);
} else if (keyMatchers[Command.TOGGLE_SHELL_INPUT_FOCUS](key)) {
if (activePtyId || shellFocused) {
setShellFocused((prev) => !prev);
if (activePtyId || embeddedShellFocused) {
setEmbeddedShellFocused((prev) => !prev);
}
}
},
@@ -941,7 +941,7 @@ Logging in with Google... Please restart Gemini CLI to continue.
handleSlashCommand,
cancelOngoingRequest,
activePtyId,
shellFocused,
embeddedShellFocused,
settings.merged.general?.debugKeystrokeLogging,
],
);
@@ -1069,7 +1069,7 @@ Logging in with Google... Please restart Gemini CLI to continue.
isRestarting,
extensionsUpdateState,
activePtyId,
shellFocused,
embeddedShellFocused,
}),
[
historyManager.history,
@@ -1145,7 +1145,7 @@ Logging in with Google... Please restart Gemini CLI to continue.
currentModel,
extensionsUpdateState,
activePtyId,
shellFocused,
embeddedShellFocused,
],
);
@@ -1207,9 +1207,9 @@ Logging in with Google... Please restart Gemini CLI to continue.
startupWarnings: props.startupWarnings || [],
}}
>
<FocusContext.Provider value={isFocused}>
<ShellFocusContext.Provider value={isFocused}>
<App />
</FocusContext.Provider>
</ShellFocusContext.Provider>
</AppContext.Provider>
</ConfigContext.Provider>
</UIActionsContext.Provider>