()
| 31 | } |
| 32 | |
| 33 | function 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. |
no test coverage detected