summaryrefslogtreecommitdiff
path: root/packages/cli/src/ui/App.tsx
diff options
context:
space:
mode:
authorJacob Richman <[email protected]>2025-06-23 05:42:20 +0000
committerGitHub <[email protected]>2025-06-23 05:42:20 +0000
commit156feff5b19f98dc097603abc408a86f82f6d149 (patch)
tree84f365600b106fa1f605e63fe3d3f9570562db5a /packages/cli/src/ui/App.tsx
parent523aeec544f7c184bbd6e763fd6027b72a4d0fdf (diff)
Fix so that pressing ctrl-s a second time toggles off constrain height mode (#1306)
Diffstat (limited to 'packages/cli/src/ui/App.tsx')
-rw-r--r--packages/cli/src/ui/App.tsx4
1 files changed, 3 insertions, 1 deletions
diff --git a/packages/cli/src/ui/App.tsx b/packages/cli/src/ui/App.tsx
index 5b116869..7d2e62dd 100644
--- a/packages/cli/src/ui/App.tsx
+++ b/packages/cli/src/ui/App.tsx
@@ -295,11 +295,13 @@ const App = ({ config, settings, startupWarnings = [] }: AppProps) => {
);
useInput((input: string, key: InkKeyType) => {
+ let enteringConstrainHeightMode = false;
if (!constrainHeight) {
// Automatically re-enter constrain height mode if the user types
// anything. When constrainHeight==false, the user will experience
// significant flickering so it is best to disable it immediately when
// the user starts interacting with the app.
+ enteringConstrainHeightMode = true;
setConstrainHeight(true);
// If our pending history item happens to exceed the terminal height we will most likely need to refresh
@@ -335,7 +337,7 @@ const App = ({ config, settings, startupWarnings = [] }: AppProps) => {
return;
}
handleExit(ctrlDPressedOnce, setCtrlDPressedOnce, ctrlDTimerRef);
- } else if (key.ctrl && input === 's') {
+ } else if (key.ctrl && input === 's' && !enteringConstrainHeightMode) {
setConstrainHeight(false);
}
});