Skip to content

Commit

Permalink
new user-definable control char syntax (#873)
Browse files Browse the repository at this point in the history
  • Loading branch information
mintty committed May 26, 2019
1 parent 8e51146 commit aef7d25
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 9 deletions.
20 changes: 11 additions & 9 deletions docs/mintty.1
Original file line number Diff line number Diff line change
Expand Up @@ -2267,15 +2267,17 @@ in order to prevent that input of Ctrl+_ would be inhibited.

Supported actions are described as follows:
.br
\(en \fB"string"\fP or \fB\(aqstring\(aq\fP: enters the literal string
\(en \fB"\fP\fIstring\fP\fB"\fP or \fB\(aq\fP\fIstring\fP\fB\(aq\fP: enters the literal string
.br
\(en \fB\`command\` (**)\fP: enters the output of the command
\(en \fB^\fP\fIchar\fP: enters a control char ('@'...'_' or '?' for DEL)
.br
\(en \fInumber (***)\fP: enters the escape sequence CSI\fInumber\fP[;\fImod\fP]~
\(en \fB\`\fP\fIcommand\fP\fB\`\fP (**): enters the output of the command
.br
\(en \fBfullscreen (*)\fP: switches to fullscreen mode
\(en \fInumber\fP (***): enters the escape sequence CSI\fInumber\fP[;\fImod\fP]~
.br
\(en \fBtoggle-fullscreen (*)\fP: toggles fullscreen mode
\(en \fBfullscreen\fP (*): switches to fullscreen mode
.br
\(en \fBtoggle-fullscreen\fP (*): toggles fullscreen mode
.br
\(en \fBwin-max\fP: resizes to window size
.br
Expand All @@ -2293,13 +2295,13 @@ Supported actions are described as follows:
.br
\(en \fBoptions\fP: opens the Options dialog
.br
\(en \fBmenu-text (*)\fP: opens the context menu at the cursor position
\(en \fBmenu-text\fP (*): opens the context menu at the cursor position
.br
\(en \fBmenu-pointer (*)\fP: opens the context menu at the mouse position
\(en \fBmenu-pointer\fP (*): opens the context menu at the mouse position
.br
\(en \fBsearch\fP: opens the search bar
.br
\(en \fBdefault-size (*)\fP: switches to default terminal size
\(en \fBdefault-size\fP (*): switches to default terminal size
.br
\(en \fBscrollbar-outer\fP: toggles the scrollbar (xterm compatible)
.br
Expand Down Expand Up @@ -2351,7 +2353,7 @@ Supported actions are described as follows:
.br
\(en \fBtoggle-char-info\fP: toggles character info display
.br
\(en \fBexport-html (*)\fP: exports the screen as an HTML file
\(en \fBexport-html\fP (*): exports the screen as an HTML file
.br
\(en \fBprint-screen\fP: print screen contents
.br
Expand Down
18 changes: 18 additions & 0 deletions src/wininput.c
Original file line number Diff line number Diff line change
Expand Up @@ -1633,6 +1633,24 @@ pick_key_function(wstring key_commands, char * tag, int n, uint key, mod_keys mo
ret = true;
}
}
else if (*fct == '^' && wcslen(fct) == 2) {
char cc[2];
cc[1] = ' ';
if (fct[1] == '?')
cc[1] = '\177';
else if (fct[1] == ' ' || (fct[1] >= '@' && fct[1] <= '_')) {
cc[1] = fct[1] & 0x1F;
}
if (cc[1] != ' ') {
if (mods & MDK_ALT) {
cc[0] = '\e';
child_send(cc, 2);
}
else
child_send(&cc[1], 1);
ret = true;
}
}
else if (*fct == '`' && fct[wcslen(fct) - 1] == '`') {
fct[wcslen(fct) - 1] = 0;
char * cmd = cs__wcstombs(&fct[1]);
Expand Down
1 change: 1 addition & 0 deletions wiki/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ Configuration
* New user-definable key name prefix ‘*’ to define for all modifiers.
* New user-definable modifier key assignments super and hyper.
* New user-definable function paste-path (mintty/wsltty#161).
* New user-definable control char syntax (#873).
* New prefixes U/Y (for super/hyper) for user-defined keys.
* New user-definable numeric action, entering a function key sequence.
* New option BellInterval to squash BEL sequences (#865).
Expand Down

0 comments on commit aef7d25

Please sign in to comment.