Escape key no longer clears command line in v24

Oct 24, 2011
71
1
I've been using the escape key for many years to clear the command line. I just updated from v21 and escape no long works, I've also used escape in the past to exit from LIST. That no long works either. I can get used to Q to leave LIST, but how do I clear the command line?
 
May 20, 2008
9,199
60
Syracuse, NY, USA
The first thing I'd try is (in TCC) OPTION ... Tab = Keyboard ... Category = Editing ... KeyCommands = EraseLine ... see what the assignments are and add Esc if necessary.
 
Oct 24, 2011
71
1
Thanks, but I had already tried that. I don't believe those commands are for the console command line because the assigned key is Crtl+y and that doesn't work either.
 
Oct 24, 2011
71
1
Actually, I found by further checking the the Escape key to clear the command line is a feature of Windows' Console. Apparently TCC 24 is blocking the Escape somehow because I have a TCC 21 console open and Escape clears the command line in that console.
 
May 20, 2008
9,199
60
Syracuse, NY, USA
Thanks, but I had already tried that. I don't believe those commands are for the console command line because the assigned key is Crtl+y and that doesn't work either.
As far as I know they are precisely for the console. And Ctrl-Y should be Clipboard\Copy. If you have Ctrl-Y for Editing\EraseLine repalce it with Esc.
 
Oct 24, 2011
71
1
As far as I know they are precisely for the console. And Ctrl-Y should be Clipboard\Copy. If you have Ctrl-Y for Editing\EraseLine repalce it with Esc.
That doesn't help. As I said, Escape to clear the command line is a Windows console shortcut, not a TCC shortcut. TCC 24 must be blocking the escape from reaching windows. Escape also clears the command line in a CMD.EXE window.

The Editing shortcuts in Option are apparently for the IDE and Editor.
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
3,797
48
Albuquerque, NM
prospero.unm.edu
It all works as expected for me, except that I can not assign the ESC key using the dialog. Pressing ESC while "New Shortcut Key" has the focus gives me a backarrow, not the "Esc" string it ought to:

EscAsBackarrow.png

So here's my low-tech solution:
Code:
echo %@iniwrite["%_ininame",Keys,EraseLine,]
echo %@iniwrite["%_ininame",Keys,EraseLine,Esc]
... then exit and restart Take Command.

(The first line deletes any existing EraseLine directive; the second recreates it with the correct value. Deleting the directive first should not usually be necessary, but if the existing line contains control characters it can confuse WritePrivateProfileString(). And my putzing around with the OPTION dialog managed to put -- you guessed it -- an ESC character into the .INI file. Urk!)
 
Oct 24, 2011
71
1
It all works as expected for me, except that I can not assign the ESC key using the dialog. Pressing ESC while "New Shortcut Key" has the focus gives me a backarrow, not the "Esc" string it ought to:

View attachment 2232

So here's my low-tech solution:
Code:
echo %@iniwrite["%_ininame",Keys,EraseLine,]
echo %@iniwrite["%_ininame",Keys,EraseLine,Esc]
... then exit and restart Take Command.

(The first line deletes any existing EraseLine directive; the second recreates it with the correct value. Deleting the directive first should not usually be necessary, but if the existing line contains control characters it can confuse WritePrivateProfileString(). And my putzing around with the OPTION dialog managed to put -- you guessed it -- an ESC character into the .INI file. Urk!)
I'm not sure I'm being understood. I'm talking about the command line in a console window. EraseLine in the options shouldn't effect that because it's a built-in Windows shortcut. ESC clears the command line in a Windows console and it works in a TCC21 console window and in a CMD console window, but it does not work in a TCC24 console window.
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
3,797
48
Albuquerque, NM
prospero.unm.edu
I'm not sure I'm being understood. I'm talking about the command line in a console window. EraseLine in the options shouldn't effect that because it's a built-in Windows shortcut. ESC clears the command line in a Windows console and it works in a TCC21 console window and in a CMD console window, but it does not work in a TCC24 console window.
If you detach TCC from Take Command, does the ESC key start working? (Right-click on the tab and choose "Detach Tab".)
Conversely, if you run CMD.EXE in a Take Command tab, does the ESC key stop working?
 
Oct 24, 2011
71
1
I have the same problem running a standalone TCC. If I run CMD in a Take Command tab, -ESC works as expected.

But I still have TCC21 installed and there is no problem in 21, only in 24.
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
3,797
48
Albuquerque, NM
prospero.unm.edu
I have the same problem running a standalone TCC. If I run CMD in a Take Command tab, -ESC works as expected.
If Take Command were swallowing ESC keystrokes, I would expect it to affect CMD.EXE too; and standalone TCC windows would not have the issue.

If you run TCC.EXE with the /I startup option, do you still have the problem?
 
Oct 24, 2011
71
1
Esc works as expected with two Is.
I notice there''s a bunch of new stuff in the .ini file in the keys section that wasn't there before installing 24.0.
 
Oct 24, 2011
71
1
But I have a TCC21 console open. It's using the same .ini file and ESC works as expected. It seems maybe some addition to the .ini file that 21 doesn't respond to but 24 does.
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
3,797
48
Albuquerque, NM
prospero.unm.edu
Esc works as expected with two Is.
I notice there''s a bunch of new stuff in the .ini file in the keys section that wasn't there before installing 24.0.
Okay; the problem is definitely in your .INI file, almost certainly in that [Keys] section. I suggest that you close all instances of Take Command and TCC, then open your .INI file in a text editor and delete that entire section. The whole thing, the [Keys] header line and all the directives under it.

I understand that you're using the same file for Take Command 21. That's okay. Version 21 does not use that [Keys] section at all, so deleting it will not affect v21.
 
Oct 24, 2011
71
1
I found the problem, and you led me there. Thanks.

ERASELINE was in the .ini file twice. Once in the [4NT] section and once in the [KEYS] section.
EraseLine=Ctrl-Y

I changed both instances to
EraseLine=Ctrl-Y Esc

That fixed it and the options under keyboard now lists the ESC key. That's apparently a bug in the Options that you can't enter the escape key.
 
Oct 24, 2011
71
1
Yes, it is. Even though Ctrl-Y is there, it does not clear the command line. I'll remove it.
Thanks very much.
 
May 20, 2008
9,199
60
Syracuse, NY, USA
I'm not sure I'm being understood. I'm talking about the command line in a console window. EraseLine in the options shouldn't effect that because it's a built-in Windows shortcut. ESC clears the command line in a Windows console and it works in a TCC21 console window and in a CMD console window, but it does not work in a TCC24 console window.
TCC opts out of Windows normal console input-output so it can provide better command line editing. It has always done that. TCC processes Esc. You should have
EraseLine=Esc
in the [Keys] section of your TCMD.INI.
 
Oct 24, 2011
71
1
I readily admit that I know very little about the internal workings of Take Command. It's a tool I use to get my real work done. I'm often reluctant to upgrade because invariably something has changed that gives me trouble and I don't really want to deal with it. :smile:
In any case, thanks for the help. I'll test 24 for a few more days before removing 21. Now back to work.