The "ESC-ESC" problem

The "ESC-ESC" problem

Post by Michal Kresli » Sat, 06 Jan 1996 04:00:00



How could I make Linux consider one ESC is enough? Why does user have to
press ESC twice when working in MC? Is there any way to solve this?
Thanks.
                                                        Michal Kreslik
 
 
 

The "ESC-ESC" problem

Post by Chuck Mart » Sat, 06 Jan 1996 04:00:00



> How could I make Linux consider one ESC is enough? Why does user have to
> press ESC twice when working in MC? Is there any way to solve this?
> Thanks.
>                                                    Michal Kreslik

The reason that happens is because it's a Unix program, and Unix is
designed so that the "meta" key ("alt" on a PC) transmits an ESC followed
by the key it's being pressed along with.  This allows you to use all of
those functions from a terminal without a "meta" key by using the ESC key
followed by the desired key.  If you don't want to hit a key twice, there
should be another way of accomplishing your goal.  Usually it's F10.

Chuck

 
 
 

The "ESC-ESC" problem

Post by Miguel de Ica » Sat, 06 Jan 1996 04:00:00


Quote:> How could I make Linux consider one ESC is enough? Why does user have to
> press ESC twice when working in MC? Is there any way to solve this?
> Thanks.

Set the old_esc_mode variable to 1 in your .mc.ini file (it's in your
home directory).

Miguel.
--

The GNU Midnight Commander: http://stekt.oulu.fi/~jtklehto/mc/

 
 
 

The "ESC-ESC" problem

Post by Al Longye » Sun, 07 Jan 1996 04:00:00




>> How could I make Linux consider one ESC is enough? Why does user have to
>> press ESC twice when working in MC? Is there any way to solve this?
>> Thanks.
>>                                                        Michal Kreslik
>The reason that happens is because it's a Unix program, and Unix is
>designed so that the "meta" key ("alt" on a PC) transmits an ESC followed
>by the key it's being pressed along with.  This allows you to use all of
>those functions from a terminal without a "meta" key by using the ESC key
>followed by the desired key.  If you don't want to hit a key twice, there
>should be another way of accomplishing your goal.  Usually it's F10.

That's true. However, if you were to _write_ programs then you should do
one of two things to avoid writing programs which hang in this manner.

1. Use [n]curses to do the input. It does things properly.

or,

2. When you see the Meta (Escape) key, look for the next character to
   follow within a short time period. If you don't see the key in, oh,
   one second, then assume that you just received the true Escape
   key. Use select() to perform the timeout condition on the read buffer.

   If you were to do things absolutely properly, then the timeout would be
   a function of the transmission rate to the terminal.

--

The above opinions do not necessarily represent those of the Management
of System Integrators nor any of its subsidiaries.

 
 
 

The "ESC-ESC" problem

Post by Chuck Mart » Tue, 09 Jan 1996 04:00:00



> 2. When you see the Meta (Escape) key, look for the next character to
>    follow within a short time period. If you don't see the key in, oh,
>    one second, then assume that you just received the true Escape
>    key. Use select() to perform the timeout condition on the read buffer.
>    If you were to do things absolutely properly, then the timeout would be
>    a function of the transmission rate to the terminal.

Wouldn't that effectively prevent you from using the program from a
terminal without a Meta key?  I'm not sure what the likelihood of that
happening would be, so maybe it isn't an important consideration
nowadays, but if you did ever find yourself in that position, then you
couldn't access any of the Meta key functions unless you were very fast
at pressing the ESC+key combination, if it worked at all.  Every time you
pressed the ESC key, you would exit the program (or the section of the
program you were currently in).

Chuck

 
 
 

1. How to "escape" from dreaded esc-esc?

Please squash this minor annoyance.

On my Sun using csh, pressing "esc" once enables filename completion.
Under Linux using tcsh, I need to press escape twice.  I want it to
act like the Sun.  Sure, it is minor, but I probably do this over
a hundred times each hour.  Any suggestions?

Jeff Arnholt
Mayo Clinic
--


Mayo Medical and Graduate Schools        
200 1st St. SW, Rochester, MN 55905

2. connecting xt as a terminal

3. Suse 7.2 ESC-ESC for commandoline fillout?

4. RH 5.2 : does it support scsi AVA1505

5. Help to change the Esc-Esc pattern matching functionality

6. BSDCon 2003 - Call for Papers

7. Does Esc-Esc work on Solaris?

8. 1.3.45 Floppy problem

9. Help to change the Esc-Esc pattern matching functionality

10. esc-esc on OSF1 v5.1

11. Esc-Esc does not work

12. - ksh ESC-ESC filename complete?

13. Would like to use ESC-ESC