You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My laptop does not have an insert key (ya' c'n delete but ya' c'n not insert).
Any way of getting an option so that someone can create a new default key? (I
like Ctl-C copy, Ctl-V paste).
Original issue reported on code.google.com by [email protected] on 14 Aug 2013 at 9:01
Unfortunately is used to abort the execution of a command SIGINT. However it would be interesting to implement a layer of key mapping customization depending on the current context.
This could be implemented in the .minttyrc like this:
key_mapping:
<C-c>:
process: vim, ed
action: <S-Ins>
Interactive and especially screen-oriented applications typically grab those control keys, remapping them from SIGINT etc. And so does indeed vim, ^C does not abort vim. If it does not do something useful either, that's a problem of vim, not mintty. I guess it could be remapped in vim.
It is not a traditional function of a terminal to mangle control keys. It is rather generally expected that they deliver what they are meant to, to be able to "control" all kinds of programs with them, each in its respective way.
If we'd like to remap keys on an application-specific basis, the general problem arises that a terminal does not know which application is currently interacting with the screen as there can be a tree of applications spawned from the terminal, normally beginning with a shell. Of course the terminal could analyse the process tree to find its youngest "leaf" element but in theory there could be multiple and also it's not necessarily a leaf that is interacting with the terminal (imagine an editor has started some filter processes...).
Having said all this, we could talk about remapping things like function keys, or some of those useless keys like Break etc. If you have an idea to use one of those and how to configure them, tell me.
Otherwise, about remapping control keys, that's not a terminal feature and I would prefer to close that issue.
For the identification of the running process we might simply monitor a cygwin2mintty communication file or even environment variables. With this first soltion one can identify the running context with something like:
alias vim='echo -e "context=vim" > /dev/mintty; /usr/bin/vim'
This could let us imagine plenty of other functionalities like:
I thought about something more straightforward like the remapping of useless keys as I had suggested.
I have implemented options to map the Break and Pause keys. This fixes your original issue not having an Insert key, so I'll close the issue.
The other idea to have some application-specific configuration really needs to settle for a while as I am hesitating to introduce any kind of process interaction here which might introduce unexpected trouble...
Activity
nowox commentedon Jun 30, 2015
Unfortunately is used to abort the execution of a command
SIGINT. However it would be interesting to implement a layer of key mapping customization depending on the current context.This could be implemented in the
.minttyrclike this:mintty commentedon Jun 30, 2015
Some remarks:
Otherwise, about remapping control keys, that's not a terminal feature and I would prefer to close that issue.
nowox commentedon Jun 30, 2015
Good remarks.
For the identification of the running process we might simply monitor a cygwin2mintty communication file or even environment variables. With this first soltion one can identify the running context with something like:
This could let us imagine plenty of other functionalities like:
echo -e "fullscreen=1"
To put mintty in fullscreen mode.
mintty commentedon Jul 1, 2015
I thought about something more straightforward like the remapping of useless keys as I had suggested.
I have implemented options to map the Break and Pause keys. This fixes your original issue not having an Insert key, so I'll close the issue.
The other idea to have some application-specific configuration really needs to settle for a while as I am hesitating to introduce any kind of process interaction here which might introduce unexpected trouble...
options Break and Pause to configure mappings for these keys (#399)
mintty commentedon Jul 2, 2015
... you can easily send it respective escape sequences, ESC[9;1t or ESC[10;1t
user-defined shortcuts and function keys (#705, #602, #645, #399, #252,…
user-defined special keys (#705, #602, #645, #399, #252, ~#726, ~#524, ~
user-defined keypad keys (#705, #602, #645, #399, #252, ~#726, ~#524, ~…
mintty commentedon Sep 20, 2018
Released 2.9.1.
allow user-defined mappings for Ctrl/Alt/Super/Hyper-modified charact…
mintty commentedon Mar 25, 2022
Released 3.6.0.