// Disable mouse reporting and show cursor. Defensive null check
// here in case closeTerminal() is called twice.
if (output != null) {
- output.printf("%s%s%s", mouse(false), cursor(true), normal());
+ output.printf("%s%s%s", mouse(false), cursor(true), defaultColor());
output.flush();
}
heightPixels = 400;
}
}
+ if ((params.size() > 2) && (params.get(0).equals("6"))) {
+ if (debugToStderr) {
+ System.err.printf("windowOp text cell pixels: " +
+ "height %s width %s\n",
+ params.get(1), params.get(2));
+ }
+ try {
+ widthPixels = width * Integer.parseInt(params.get(2));
+ heightPixels = height * Integer.parseInt(params.get(1));
+ } catch (NumberFormatException e) {
+ if (debugToStderr) {
+ e.printStackTrace();
+ }
+ }
+ if (widthPixels <= 0) {
+ widthPixels = 640;
+ }
+ if (heightPixels <= 0) {
+ heightPixels = 400;
+ }
+ }
resetParser();
return;
default:
* @return the string to emit to xterm
*/
private String xtermReportWindowPixelDimensions() {
- return "\033[14t";
+ // We will ask for both window and text cell dimensions, and
+ // hopefully one of them will work.
+ return "\033[14t\033[16t";
}
/**
}
/**
- * Create a SGR parameter sequence to reset to defaults.
+ * Create a SGR parameter sequence to reset to VT100 defaults.
*
* @return the string to emit to an ANSI / ECMA-style terminal,
* e.g. "\033[0m"
return normal(true) + rgbColor(false, Color.WHITE, Color.BLACK);
}
+ /**
+ * Create a SGR parameter sequence to reset to ECMA-48 default
+ * foreground/background.
+ *
+ * @return the string to emit to an ANSI / ECMA-style terminal,
+ * e.g. "\033[0m"
+ */
+ private String defaultColor() {
+ /*
+ * VT100 normal.
+ * Normal (neither bold nor faint).
+ * Not italicized.
+ * Not underlined.
+ * Steady (not blinking).
+ * Positive (not inverse).
+ * Visible (not hidden).
+ * Not crossed-out.
+ * Default foreground color.
+ * Default background color.
+ */
+ return "\033[0;22;23;24;25;27;28;29;39;49m";
+ }
+
/**
* Create a SGR parameter sequence to reset to defaults.
*