File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -25,10 +25,9 @@ func checkSixel() bool {
2525 return true
2626 }
2727 s , err := terminal .MakeRaw (1 )
28- if err ! = nil {
29- return false
28+ if err = = nil {
29+ defer terminal . Restore ( 1 , s )
3030 }
31- defer terminal .Restore (1 , s )
3231 _ , err = os .Stdout .Write ([]byte ("\x1b [c" ))
3332 if err != nil {
3433 return false
@@ -40,6 +39,13 @@ func checkSixel() bool {
4039 if err != nil {
4140 return false
4241 }
42+ // Check tmux (sixel enabled)
43+ // See: CSI Ps c, Ps = 4 (Sixel graphics)
44+ // https://invisible-island.net/xterm/ctlseqs/ctlseqs.html
45+ // NOTE: tmux does not return VT name.
46+ if bytes .HasPrefix (b [:n ], []byte ("\x1b [?1;2;4c" )) {
47+ return true
48+ }
4349 var supportedTerminals = []string {
4450 "\x1b [?62;" , // VT240
4551 "\x1b [?63;" , // wsltty
You can’t perform that action at this time.
0 commit comments