feat(ssh): bump restty and follow upstream tailscale ssh

This commit is contained in:
Aarnav Tale
2026-08-27 14:59:47 -07:00
parent b9aa99c45e
commit 29afac60f6
31 changed files with 1653 additions and 1814 deletions
+26
View File
@@ -0,0 +1,26 @@
tsconnect: let the caller choose the PTY terminal type and modes
Upstream requests a bare "xterm" PTY with no terminal modes. Headplane
renders with Ghostty and ships a Nerd Font, so it needs xterm-256color
and sane modes for anything colour-aware on the far side.
Applied to cmd/hp_ssh/wasm_js.go by scripts/sync-tsconnect.sh.
--- a/wasm/wasm_js.go
+++ b/wasm/wasm_js.go
@@ -484,7 +484,14 @@
if s.pendingResizeCols != 0 {
cols = s.pendingResizeCols
}
- err = session.RequestPty("xterm", rows, cols, ssh.TerminalModes{})
+ termType := "xterm"
+ if v := s.termConfig.Get("termType"); v.Type() == js.TypeString {
+ termType = v.String()
+ }
+ err = session.RequestPty(termType, rows, cols, ssh.TerminalModes{
+ ssh.ECHO: 1, ssh.ICANON: 1, ssh.ISIG: 1, ssh.ICRNL: 1, ssh.IUTF8: 1,
+ ssh.TTY_OP_ISPEED: 14400, ssh.TTY_OP_OSPEED: 14400,
+ })
if err != nil {
writeError("Pseudo Terminal", err)
return