mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-29 06:25:16 -07:00
fix(cli): ctrl c/ctrl d close cli when in dialogs (#8685)
Co-authored-by: Jacob Richman <jacob314@gmail.com> Co-authored-by: matt korwel <matt.korwel@gmail.com>
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import { Box } from 'ink';
|
||||
import { Box, Text } from 'ink';
|
||||
import { StreamingContext } from './contexts/StreamingContext.js';
|
||||
import { Notifications } from './components/Notifications.js';
|
||||
import { MainContent } from './components/MainContent.js';
|
||||
@@ -12,6 +12,7 @@ import { DialogManager } from './components/DialogManager.js';
|
||||
import { Composer } from './components/Composer.js';
|
||||
import { useUIState } from './contexts/UIStateContext.js';
|
||||
import { QuittingDisplay } from './components/QuittingDisplay.js';
|
||||
import { theme } from './semantic-colors.js';
|
||||
|
||||
export const App = () => {
|
||||
const uiState = useUIState();
|
||||
@@ -29,6 +30,22 @@ export const App = () => {
|
||||
<Notifications />
|
||||
|
||||
{uiState.dialogsVisible ? <DialogManager /> : <Composer />}
|
||||
|
||||
{uiState.dialogsVisible && uiState.ctrlCPressedOnce && (
|
||||
<Box marginTop={1}>
|
||||
<Text color={theme.status.warning}>
|
||||
Press Ctrl+C again to exit.
|
||||
</Text>
|
||||
</Box>
|
||||
)}
|
||||
|
||||
{uiState.dialogsVisible && uiState.ctrlDPressedOnce && (
|
||||
<Box marginTop={1}>
|
||||
<Text color={theme.status.warning}>
|
||||
Press Ctrl+D again to exit.
|
||||
</Text>
|
||||
</Box>
|
||||
)}
|
||||
</Box>
|
||||
</Box>
|
||||
</StreamingContext.Provider>
|
||||
|
||||
Reference in New Issue
Block a user