feat: fork ink and make it work nicely

This commit is contained in:
Brooklyn Nicholson 2026-04-11 11:29:08 -05:00
parent cb79018977
commit 8760faf991
139 changed files with 24952 additions and 140 deletions

View file

@ -0,0 +1,41 @@
type TerminalName = string | null
function detectTerminal(): TerminalName {
if (process.env.CURSOR_TRACE_ID) {
return 'cursor'
}
if (process.env.TERM === 'xterm-ghostty') {
return 'ghostty'
}
if (process.env.TERM?.includes('kitty')) {
return 'kitty'
}
if (process.env.TERM_PROGRAM) {
return process.env.TERM_PROGRAM
}
if (process.env.TMUX) {
return 'tmux'
}
if (process.env.STY) {
return 'screen'
}
if (process.env.KITTY_WINDOW_ID) {
return 'kitty'
}
if (process.env.WT_SESSION) {
return 'windows-terminal'
}
return process.env.TERM ?? null
}
export const env = {
terminal: detectTerminal()
}