Skip to content

The agent that grows with you

fix(desktop): stop ⌥-click spraying cursor escapes into the terminal

Brooklyn Nicholson4d6589c69c1e
diff --git a/apps/desktop/src/app/right-sidebar/terminal/use-terminal-session.ts b/apps/desktop/src/app/right-sidebar/terminal/use-terminal-session.ts
index d60bb71bdd4..888d197a55a 100644
--- a/apps/desktop/src/app/right-sidebar/terminal/use-terminal-session.ts
+++ b/apps/desktop/src/app/right-sidebar/terminal/use-terminal-session.ts
@@ -499,6 +499,11 @@ export function useTerminalSession({
const term = new Terminal({
allowProposedApi: true,
+ // ⌥-drag is our force-selection gesture (below), and xterm's default
+ // alt-click-moves-cursor claims the same click, emitting one cursor
+ // left/right escape per column of travel — shells that don't consume them
+ // echo the raw `^[[D` burst into the buffer. One gesture, one meaning.
+ altClickMovesCursor: false,
// Opaque canvas = WebGL's crisp fast-path. allowTransparency instead bakes
// glyphs as grayscale-alpha for compositing over a see-through canvas, which
// reads soft on every platform; VS Code keeps it off and our surface