#58 detect iterm2
authorKevin Lamonte <kevin.lamonte@gmail.com>
Wed, 30 Oct 2019 18:03:50 +0000 (13:03 -0500)
committerKevin Lamonte <kevin.lamonte@gmail.com>
Wed, 30 Oct 2019 18:03:50 +0000 (13:03 -0500)
src/jexer/backend/ECMA48Terminal.java

index 05c7575e1914ea9658b47bf2ce79b473c602d936..b45e8d418235c84f45ed06dee861e38a762cab0b 100644 (file)
@@ -1172,11 +1172,12 @@ public class ECMA48Terminal extends LogicalScreen
 
         // Enable mouse reporting and metaSendsEscape
         this.output.printf("%s%s", mouse(true), xtermMetaSendsEscape(true));
-        this.output.flush();
 
         // Request xterm use the sixel settings we want
         this.output.printf("%s", xtermSetSixelSettings());
 
+        this.output.flush();
+
         // Query the screen size
         sessionInfo.queryWindowSize();
         setDimensions(sessionInfo.getWindowWidth(),
@@ -1264,11 +1265,12 @@ public class ECMA48Terminal extends LogicalScreen
 
         // Enable mouse reporting and metaSendsEscape
         this.output.printf("%s%s", mouse(true), xtermMetaSendsEscape(true));
-        this.output.flush();
 
         // Request xterm use the sixel settings we want
         this.output.printf("%s", xtermSetSixelSettings());
 
+        this.output.flush();
+
         // Query the screen size
         sessionInfo.queryWindowSize();
         setDimensions(sessionInfo.getWindowWidth(),
@@ -2858,6 +2860,13 @@ public class ECMA48Terminal extends LogicalScreen
                             }
                             jexerImages = true;
                         }
+                        if (x.equals("1337")) {
+                            // Terminal reports iTerm2 images support
+                            if (debugToStderr) {
+                                System.err.println("Device Attributes: iTerm2 images");
+                            }
+                            iterm2Images = true;
+                        }
                     }
                     if (jexerImages == false) {
                         // Terminal does not support Jexer images, disable