(Sorta back on topic: 'screen') How to fix backspace/delete key in OS/X (Mac)

unix

    Next

  • 1. tcsh-style autocorrect in bash or zsh?
    I'd like to get this hugely-useful tcsh functionality in bash or zsh: autocorrect (+) If set, the spell-word editor command is invoked automatically before each completion attempt. In tcsh this works as follows: host:~> cat /ect/pass<TAB key pressed> produces: host:~> cat /etc/passwd Note that I'm talking about *exact* behavior: pressing TAB (and TAB only) will cause spelling correction followed by completion, without a prompt. Is there any way to do this in either bash or zsh? I found one reference that said the following would do it for zsh...: zstyle ':completion:::::' completer _complete _approximate zstyle ':completion:*:approximate:*' max-errors 2 ...but this doesn't appear to work (on its own, anyway). - John
  • 2. One file for "stout+sterror" and another for "sterror"; it's possible?
    2008-03-14, 16:13(+00), luciosan: [...] >>> { cmd 2>&1 >&3 | tee -a error.log >&3; } 3>> log.txt > I tried your command, but the log.txt file contains sterror and stout > not in order.In other words, I wrote a script to generate: > 1->error > 1->out > 2->error > 2->out > 3->error > 3->out > 4->error > 4->out > > and I've redirect the error in sterror and in a file (error.log); and > sterror+stout in another file (out.log) > > The result is: [...] > but "cat out.log" contains > 1->out > 2->out > 3->out > 4->out > 1->error > 2->error > 3->error > 4->error > > As you can see, the out.log contains sterror+stout but not in order. [...] Above, you have too applications running concurrently (cmd and tee) and writing to a same file. There's little chance that you'll have them synchronise themselves so as to get the order you wish. Note that I forgot to mention zsh: setopt mult_ios cmd > log.txt 2>&1 2> error.log But you're likely to have the same problem. Here, the teeing is performed internally by zsh. -- Sthane
  • 3. One file for "stout+sterror" and another for "sterror"; it's possible?
    2008-03-13, 14:13(+00), luciosan: [...] > How can I redirect stout and sterror in a file and only sterror > inanother file at the same time? > > For example, If I run the script: > /script.sh >> log.txt 2>&1 > > It will write in "log.txt" stout and sterror. > > But, If I want write stout and sterror in "log.txt" and at the > sametime sterror in "error.log", it's possible? [...] { cmd 2>&1 >&3 | tee -a error.log >&3; } 3>> log.txt -- Sthane
  • 4. piping output and storing PID of process
    I would like to run in subshell some script and redirect it into another script. Something like this: my_first_script 2>&1 | my_second_script & But I also want to save the PID of process of "my_first_script" for future use. I know that in bash, I can use $! variable to save the PID. But, of course, after previous command the $! contains PID of "my_second_script", not "my_first_script" which I want. Any suggestions how to solve it? Thanks for all hints
  • 5. Multiple shell commands using find's -exec
    Hi, I'm just wondering whether there is a way of executing multiple shell commands with find's -exec switch? If either of ";", "&&" or "|" is used in between commands, then shell will interpret it as two separate shell commands and some times fail. I can't even use \; since find interprets it as the end of it's arguments. Any other go, than putting all commands into a script? Thanks Jeenu

(Sorta back on topic: 'screen') How to fix backspace/delete key in OS/X (Mac)

Postby gazelle » Fri, 17 Aug 2007 21:45:25 GMT

In article < XXXX@XXXXX.COM >,




It emulates xterm-color.  This is what I get if I do: echo $TERM
locally, and it is also what I get on the remote end.

Aha!  I just discovered something.  The problem is 'screen'.  The
problem only occurs when I am in 'screen' on the remote machine (which is
all the time...).  If I don't go into 'screen', then the key works
correctly.  So, I think 'screen' must be doing some kind of mapping.

How to fix *that*???

Note: I've used 'screen' for years now (consider it indispensable), but I:
1) Have never used a lot of its arcane features.
2) Don't understand about 2/3 of the man page.


Similar Threads:

1.(Somewhat OT) How to fix backspace/delete key in OS/X (Mac)

Yes, this is OT, but it is also a FAQ here.  People having problems with
their backspace key(s).

Anyway, recently started using OS/X on a MacBook.  Use ssh from 'Terminal' to
connect to shell account.  When I hit "delete", it generates: [3~
Now, note that I am well aware of solutions involving "stty erase ...",
but that's not optimal.  The right way to fix this sort of thing is to
fix what character the key sends, not to kludge the remote system to
accept whatever the key currently sends.

Note also that the key generates the right code (127) when hit locally,
but for some reason is translated when sent to ssh.

Has anyone else solved this problem?

2.backspace and delete keys using SSH

I'm having an annoying problem using F-Secure SSH on an AIX 4.3.3
machine.
When logged in via SSH the backspace key doesn't erase the character
shown on screen, it just backspaces over the top, even though AIX
recognises that the character HAS been deleted.  (NB this all works
fine via telnet.)

It doesn't seem to make any difference whether I set the emulator so
that Backspace sends Delete or vice versa, and nothing I have tried
using "stty erase" seems to help either!

I think this may to do with the SSH client rather than AIX tbh, but
does anyone have any idea how to fix it?

Many thanks

David

3.backspace and delete key mappings

I have read much on the subject of these 2 keys. Yet I have not been
able to do what I need to do. I need the backspace key to generate
0x08(^H)  and the delete key to generate 0x7f(del) during the execution
of a single  application. On all my linux boxes the backspace generates
0x7f(^?) and the del key generates  ^[[3~. I need to be able to change
that before I execute my program then change it back when my
application is done.  stty does NOT do the job nor does my application
use termdef. I have found a little expect script that does do what I
need. I execute "script program" and the keys come out like I want.

#!/usr/bin/expect

eval spawn -noecho $argv

interact {
 \177        {send "\010"}
 "\033\[3~"  {send "\177"}

However I am really looking for basic Linux commands that can be
executed from the bash shell that will do the same thing or a method of
making my application do it from within its self.

Thanks and regards
Mark

4.Backspace and Delete key mappings

I have read much on the subject of these 2 keys. Yet I have not been
able to do what I need to do. I need the backspace key to generate
0x08(^H)  and the delete key to generate 0x7f(del) during the execution
of a single  application. On all my linux boxes the backspace generates
0x7f(^?) and the del key generates  ^[[3~. I need to be able to change
that before I execute my program then change it back when my
application is done.  stty does NOT do the job nor does my application
use termdef. I have found a little expect script that does do what I
need. I execute "script program" and the keys come out like I want.

#!/usr/bin/expect

eval spawn -noecho $argv

interact {
 \177        {send "\010"}
 "\033\[3~"  {send "\177"}

However I am really looking for basic Linux commands that can be
executed from the bash shell that will do the same thing or a method of
making my application do it from within its self.

Thanks and regards
Mark

5.'/' become backspace and backspace key insert '~'

I ssh to a solaris 10 computer from a FC6 computer.
The keyboard behave properly when login as root:

root# stty
speed 38400 baud; -parity
rows = 23; columns = 80; ypixels = 0; xpixels = 0;
eol =  eol2 =  swtch < ;
brkint -inpck -istrip icrnl -ixon onlcr tab3
echo echoe echok echoctl echoke iexten

The keyboard behave improperly when login as non-root:
The '/' key acts as the backspace key.
The backspace key insert '~'.
-bash-3.00$ stty
speed 38400 baud; -parity
rows = 23; columns = 84; ypixels = 0; xpixels = 0;
erase = /; eol = ; eol2 = ; swtch < ;
brkint -inpck -istrip icrnl -ixon imaxbel onlcr tab3
echo echoe echok echoctl echoke iexten

$ bash -version
GNU bash, version 3.00.16(1)-release (sparc-sun-solaris2.10)
Copyright (C) 2004 Free Software Foundation, Inc.

Please help to fix it.
Thanks.

6. Back Space and Delete keys

7. Delete key insert "~" on ssh & other OS

8. [News] [Rival] People Still Hate Vista, Go Back to XP (or Mac OS, or Linux)



Return to unix

 

Who is online

Users browsing this forum: No registered users and 11 guest