MCPcopy Create free account
hub / github.com/Noumena-Network/code / isModernWindowsTerminal

Function isModernWindowsTerminal

src/ink/clearTerminal.ts:33–54  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

31}
32
33function isModernWindowsTerminal(): boolean {
34 // Windows Terminal sets WT_SESSION environment variable
35 if (isWindowsTerminal()) {
36 return true
37 }
38
39 // VS Code integrated terminal on Windows with ConPTY support
40 if (
41 process.platform === 'win32' &&
42 process.env.TERM_PROGRAM === 'vscode' &&
43 process.env.TERM_PROGRAM_VERSION
44 ) {
45 return true
46 }
47
48 // mintty (GitBash/MSYS2/Cygwin) supports modern escape sequences
49 if (isMintty()) {
50 return true
51 }
52
53 return false
54}
55
56/**
57 * Returns the ANSI escape sequence to clear the terminal including scrollback.

Callers 2

getClearTerminalSequenceFunction · 0.85

Calls 2

isWindowsTerminalFunction · 0.85
isMinttyFunction · 0.85

Tested by

no test coverage detected