Skip to content

Commit 76f2e6d

Browse files
committed
fix(render): always assume raw mode for terminal output
When rendering to terminal, always assume raw mode even if the input is not a TTY. This ensures consistent behavior across different terminal emulators and environments. Fixes: #1572
1 parent 7ae2c09 commit 76f2e6d

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

tea.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1031,7 +1031,15 @@ func (p *Program) Run() (returnModel Model, returnErr error) {
10311031
p.height,
10321032
)
10331033
r.setLogger(p.logger)
1034-
r.setOptimizations(p.useHardTabs, p.useBackspace, p.ttyInput == nil)
1034+
// XXX: This breaks many things especially when we want the output
1035+
// to be compatible with terminals that are not necessary a TTY.
1036+
// This was originally done to work around a Wish emulated-pty
1037+
// issue where when a PTY session is detected, and we don't
1038+
// allocate a real PTY, the terminal settings (Termios and WinCon)
1039+
// don't change and the we end up working in cooked mode instead of
1040+
// raw mode.
1041+
mapNl := false // p.ttyInput == nil
1042+
r.setOptimizations(p.useHardTabs, p.useBackspace, mapNl)
10351043
p.renderer = r
10361044
}
10371045
}

0 commit comments

Comments
 (0)