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