MCPcopy Index your code
hub / github.com/codeaashu/claude-code / isSynchronizedOutputSupported

Function isSynchronizedOutputSupported

src/ink/terminal.ts:70–118  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

68 * When supported, BSU/ESU sequences prevent visible flicker during redraws.
69 */
70export function isSynchronizedOutputSupported(): boolean {
71 // tmux parses and proxies every byte but doesn't implement DEC 2026.
72 // BSU/ESU pass through to the outer terminal but tmux has already
73 // broken atomicity by chunking. Skip to save 16 bytes/frame + parser work.
74 if (process.env.TMUX) return false
75
76 const termProgram = process.env.TERM_PROGRAM
77 const term = process.env.TERM
78
79 // Modern terminals with known DEC 2026 support
80 if (
81 termProgram === 'iTerm.app' ||
82 termProgram === 'WezTerm' ||
83 termProgram === 'WarpTerminal' ||
84 termProgram === 'ghostty' ||
85 termProgram === 'contour' ||
86 termProgram === 'vscode' ||
87 termProgram === 'alacritty'
88 ) {
89 return true
90 }
91
92 // kitty sets TERM=xterm-kitty or KITTY_WINDOW_ID
93 if (term?.includes('kitty') || process.env.KITTY_WINDOW_ID) return true
94
95 // Ghostty may set TERM=xterm-ghostty without TERM_PROGRAM
96 if (term === 'xterm-ghostty') return true
97
98 // foot sets TERM=foot or TERM=foot-extra
99 if (term?.startsWith('foot')) return true
100
101 // Alacritty may set TERM containing 'alacritty'
102 if (term?.includes('alacritty')) return true
103
104 // Zed uses the alacritty_terminal crate which supports DEC 2026
105 if (process.env.ZED_TERM) return true
106
107 // Windows Terminal
108 if (process.env.WT_SESSION) return true
109
110 // VTE-based terminals (GNOME Terminal, Tilix, etc.) since VTE 0.68
111 const vteVersion = process.env.VTE_VERSION
112 if (vteVersion) {
113 const version = parseInt(vteVersion, 10)
114 if (version >= 6800) return true
115 }
116
117 return false
118}
119
120// -- XTVERSION-detected terminal name (populated async at startup) --
121//

Callers 2

getRenderContextFunction · 0.85
terminal.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected