commit 14f45e0

delthas  ·  2025-03-03 14:51:10 +0000 UTC
parent cdda64c
Work around broken Associated Text on iTerm2

See: https://gitlab.com/gnachman/iterm2/-/issues/12177
1 files changed,  +11, -0
+11, -0
 1@@ -102,6 +102,17 @@ func New(config Config) (ui *UI, colors ConfigColors, err error) {
 2 	if err != nil {
 3 		return
 4 	}
 5+	if strings.HasPrefix(vx.TerminalID(), "iTerm2") {
 6+		// see: https://gitlab.com/gnachman/iterm2/-/issues/12177
 7+		vx.Close()
 8+		vx, err = vaxis.New(vaxis.Options{
 9+			DisableMouse: !config.Mouse,
10+			CSIuBitMask:  vaxis.CSIuDisambiguate | vaxis.CSIuReportEvents | vaxis.CSIuAlternateKeys,
11+		})
12+		if err != nil {
13+			return
14+		}
15+	}
16 	ui.vx = &Vaxis{
17 		Vaxis:  vx,
18 		window: vx.Window(),