How to? Control-U alias for Escape (command line editing)

May 2, 2012
25
0
Chicago USA
In my bash/zsh alternate universe, and in a lifetime of VMS and UNIX use before that, I grew so accustomed to typing ^U to delete the entire command line (what ESC does in TCC).

I did manage to come up with a working alias some time ago, but a hard crash and a flawed recovery later I have lost that alias, and despite my renewed attempts to figure it out a second time I remain stymied.

How can I alias <C-u> to <Esc>?
 
May 29, 2008
571
4
Groton, CT
In my bash/zsh alternate universe, and in a lifetime of VMS and UNIX use before that, I grew so accustomed to typing ^U to delete the entire command line (what ESC does in TCC).

I did manage to come up with a working alias some time ago, but a hard crash and a flawed recovery later I have lost that alias, and despite my renewed attempts to figure it out a second time I remain stymied.

How can I alias <C-u> to <Esc>?

In your .INI file ("%_ininame"), in the [4NT] section, add this line:
Code:
DelToBeginning=Ctrl-U

I've used this for years, due to decades of using it the same way you did, from half a lifetime of working with (and for) VMS.

You might also like:
Code:
DelWordLeft=Ctrl-J
EndLine=Ctrl-E
 
May 2, 2012
25
0
Chicago USA
In your .INI file ("%_ininame"), in the [4NT] section, add...DelToBeginning=Ctrl-U

Hot dang! That's it exactly. Thank you for that. Although I used ASR-33, ADM-3a, VT-52 and VT-100 terminals in the beginning, I became quite accustomed to the VT-220 (amber, no less), so the others will be less helpful ... but I may try mapping a few Vim keybindings that way, since they fall naturally under my fingers these days.

Much appreciated: I would likely never have found that tip again, and I was driving myself crazy in the interim. My sanity and I salute you, sir.
 
Last edited:
May 20, 2008
3,515
4
Elkridge, MD, USA
Each key can be assigned ("mapped") for a different purpose in each of the input modes: (command line) edit, list, popup, and general input. If you try to assign a key in a specific mode for which it has a different default assignment, you must first remove the default assignment by the appropriate normal key directive. The list of actions for default keys is in the HELP pages for each mode, but you need an eagle eye to find it by key names. But never fear, there is a simple experiment you can do. Add the desired assignment to your .INI file. If it does what it did before - you need the normal key directive. If it works as you want it, no normal key is needed.
 
May 2, 2012
25
0
Chicago USA
Each key can be assigned ("mapped") for a different purpose in each of the input modes
Gosh, I don't even understand what your answer means! (Well, I do understand it, but I'm unsure if I appreciate it ... or if I actually need that level of tweaking.)

I don't care if <ESC> still also clears the input line since I'll never reach for it accidentally (or deliberately, for that matter). C-u does that, even in parallel with the original binding, and that's enough for my purposes. Still, you have installed that concept in my mind, and if I ever do actually need to rebind the same key in a different mode, it will surely come in handy! So thank you for that.

In fact, I think I'll peruse the Help pages just to see what goodies I could concoct, even if at this point I'm unlikely to perform any
 
May 20, 2008
3,515
4
Elkridge, MD, USA
If your interest is limited to the issue in your OP, my post is definitely overkill. However, if you care to duplicate other 'nixisms it may be of interest. It was intended as information which is not necessarily obvious from HELP.
 
Similar threads
Thread starter Title Forum Replies Date
Jay Sage Bug With Flow Control and/or Command Grouping Support 2
D History and control-C Support 1
C Control Everything CPU usage at startup? Support 7
J Piping ANSI control sequences through 'type' Support 4
M How to? Run the control panel from a TCC session... Support 2
D How move cursor out of popup edit control after no match? Support 14
Charles Dye Control-Shift-X Support 3
F How to? Stop hijacking control-shift-z Support 6
T TCC control-C copy operation Support 3
Mordachai how to control window size? Support 10
vefatica Can I control forum drafts? Support 0
S WAD %_do_errors does not report errors when loop control variable type is not directory entry Support 1
S Forum: Where is "what's new" control information? Support 1
Jay Sage Improved Edit Control for Directory Popup Support 5
Emilio III Control characters pass through? Support 6
A Bug report: Control-C still not working Support 9
A Control-c Support 1
deleyd Commands to launch Control Panel items? Support 10
D Can alias pass parameters to for command? Support 3
Jay Sage Issue with CD_ENTER Alias Support 37
Jay Sage Issue with CD_LEAVE Alias Support 3
Jay Sage WAD Failure of Alias Command with /Z Option Support 14
R @select inside alias gives different (insanely small) window Support 7
kb6ojs ALIAS with multiple commands? Support 9
vefatica Can I alias @@Ctrl-Shift-Alt-u? Support 4
D Alias with setdos no longer works Support 21
vefatica TPIPE in an alias? Support 2
Peter Murschall TCC V26.01.3x Debugging has problems with Alias /R Support 1
Peter Murschall CMDebug 26.01.37 has problems with Alias Support 21
samintz How to? Alias or prompt? Support 1
MickeyF expand alias in cmdline with Ctrl-F in TCC Support 21
Jay Sage Directory Alias Access to FTP Servers Support 2
rps How to? Shralias and producing history.sav, alias.sav .. Support 6
J Alias @@F5 hotkey Support 2
vefatica alias.sav not accurate Support 8
Joe Caverly Using a Directory Alias with @iniwrite fails Support 14
N multiple command alias and redirection Support 0
vefatica SETLOCAL ... ALIAS ... pipes Support 2
B TCC 21.01.50 Problem with ALIAS /r and SET /r Support 2
rps How to? Alias/Command line use of *log on/off Support 2
MickeyF alias terminating before it should Support 3
JohnQSmith ALIAS /R in TCSTART.BTM Support 9
D Alias in batch file Support 3
vefatica Can't execute @ALIAS[...] Support 5
E How to? Load Alias File on Startup Support 3
I Windows 10 console does not allow alt-F4 alias to complete Support 1
MickeyF create an alias with optional parameter Support 4
nickles Alias expansion Support 7
T scrput `` in alias or function Support 2
vefatica Alias works differenltly v16 vs. v17 Support 13

Similar threads