Skip to content

Commit

Permalink
option NoAltScreen disables the alternate screen (~mintty#652)
Browse files Browse the repository at this point in the history
  • Loading branch information
mintty committed Apr 27, 2017
1 parent 5e23ef4 commit 5279abf
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 20 deletions.
8 changes: 6 additions & 2 deletions docs/mintty.1
Original file line number Diff line number Diff line change
Expand Up @@ -849,8 +849,8 @@ bolding is simulated by rendering the text twice with a one-pixel offset.
.TP
\fBShow bold as colour\fP (BoldAsColour=yes)
By default, text with the ANSI bold attribute set is displayed with a
different colour, usually with increased brightness. This can be disabled
here.
different colour, usually with increased brightness (mapping ANSI colours
0..7 to their bright variants 8..15). This can be disabled here.

Note that when \fBBoldAsFont\fP is enabled, only bold text in one of the eight
ANSI colours has its colour changed, i.e. bold text without an explicitly
Expand Down Expand Up @@ -1232,6 +1232,10 @@ is the default.
The answerback string is sent in response to the \fB^E\fP (ENQ) character.
By default, this is empty.

.TP
\fBAlternate screen\fP (NoAltScreen=false)
With this setting, the alternate screen can be disabled.

.TP
\fBApply old wraparound behaviour\fP (OldWrapModes=false)
Setting this compatibility option disables some tweaks and fixes of
Expand Down
2 changes: 2 additions & 0 deletions src/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ const config default_cfg = {
.daemonize_always = false,
// "Hidden"
.bidi = 2,
.disable_alternate_screen = false,
.app_id = W(""),
.app_name = W(""),
.app_launch_cmd = W(""),
Expand Down Expand Up @@ -297,6 +298,7 @@ options[] = {

// "Hidden"
{"Bidi", OPT_INT, offcfg(bidi)},
{"NoAltScreen", OPT_BOOL, offcfg(disable_alternate_screen)},
{"AppID", OPT_WSTRING, offcfg(app_id)},
{"AppName", OPT_WSTRING, offcfg(app_name)},
{"AppLaunchCmd", OPT_WSTRING, offcfg(app_launch_cmd)},
Expand Down
1 change: 1 addition & 0 deletions src/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ typedef struct {
bool daemonize_always;
// "Hidden"
int bidi;
bool disable_alternate_screen;
wstring app_id;
wstring app_name;
wstring app_launch_cmd;
Expand Down
44 changes: 26 additions & 18 deletions src/termout.c
Original file line number Diff line number Diff line change
Expand Up @@ -633,10 +633,6 @@ set_modes(bool state)
term.cursor_on = state;
when 40: /* Allow/disallow DECCOLM (xterm c132 resource) */
term.deccolm_allowed = state;
when 47: /* alternate screen */
term.selected = false;
term_switch_screen(state, false);
term.disptop = 0;
when 67: /* DECBKM: backarrow key mode */
term.backspace_sends_bs = state;
when 80: /* DECSDM: SIXEL display mode */
Expand Down Expand Up @@ -664,23 +660,35 @@ set_modes(bool state)
term.bell_taskbar = state;
when 1043:
term.bell_popup = state;
when 47: /* alternate screen */
if (!cfg.disable_alternate_screen) {
term.selected = false;
term_switch_screen(state, false);
term.disptop = 0;
}
when 1047: /* alternate screen */
term.selected = false;
term_switch_screen(state, true);
term.disptop = 0;
if (!cfg.disable_alternate_screen) {
term.selected = false;
term_switch_screen(state, true);
term.disptop = 0;
}
when 1048: /* save/restore cursor */
if (state)
save_cursor();
else
restore_cursor();
if (!cfg.disable_alternate_screen) {
if (state)
save_cursor();
else
restore_cursor();
}
when 1049: /* cursor & alternate screen */
if (state)
save_cursor();
term.selected = false;
term_switch_screen(state, true);
if (!state)
restore_cursor();
term.disptop = 0;
if (!cfg.disable_alternate_screen) {
if (state)
save_cursor();
term.selected = false;
term_switch_screen(state, true);
if (!state)
restore_cursor();
term.disptop = 0;
}
when 1061: /* VT220 keyboard emulation */
term.vt220_keys = state;
when 2004: /* xterm bracketed paste mode */
Expand Down
1 change: 1 addition & 0 deletions wiki/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Font rendering and display handling
* Fixed cleanup of environment variables after user command (#654).
* Fixed bidi display while showing other screen with Bidi=1 (#592, ~#392, ~#605).
* Avoid being pushed behind other windows on Ctrl+TAB (#652).
* Option NoAltScreen disables the alternate screen (~#652).

### 2.7.6 (14 Apr 2017) ###

Expand Down

0 comments on commit 5279abf

Please sign in to comment.