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

unix

    Next

  • 1. Check directory
    Hi, I want to check a directory on a 2nd server: ssh -l $USER $SERVER 'size=\`df ${BASEDIR} | grep domnotam | \`echo "awk '{print $5}'"``' but I only received error messages like: bash: `echo: command not found Please help me to correct my syntax
  • 2. ksh93: How to avoid duplicates in history?
    Good day, How may I avoid saving consecutive duplicates in my $HISTFILE when working interactively with ksh93? Duplicate history entries is one of the very few things that annoys me with ksh93. What I'm looking for is the effect of setting HISTCONTROL=ignoredups in bash. Setting that variable to this value means that the session $ date Fri Sep 26 21:09:25 BST 2003 $ date Fri Sep 26 21:09:26 BST 2003 $ date Fri Sep 26 21:09:28 BST 2003 ... would store the command "date" only once in $HISTFILE. Without a change to the ksh93 code, I assume this would involve trapping KEYBD or being very clever with the $HISTFILE variable itself. Has anyone looked at this? ... or did I overlook something? -- Andreas Ki
  • 3. Search and replace a line in a java file
    Hi, I am curiuos to find out if it is possible to find string lines in a java file: public static final String <Variable name with all caps> = ; and replace it with: public static final String <Variable name with all caps> = ""; Is there a way to replace lines looking like the first line with the last line. The name before equal sign is different for each line. I am thinking of using a shell script or regexp in java 1.4 (That is why I post in two places). Regards, //Mikael
  • 4. [OT] ksh'93 getopts --longoptions
    "Janis" < XXXX@XXXXX.COM > wrote > Reading the getopts --man page and trying the supposed syntax > I stupidly failed in getting long --options to work with ksh'93. Suggest you simply use ksh93, not ksh'93. I doubt your apostrophe is necessary. It is more common and easier to see it written simply as ksh93. Besides, your thread will no doubt be missed by others searching c.u.s. archives because they will search for the more common ksh93, without the apostrophe. It was this thought that made me decide to respond. This is all MHO, of course. Regards, -- David Thompson Foster City, CA
  • 5. explaination
    Hi! Can any body explain to me what does this line do : USER_WHO_OWNS_THE_X_SESSION=$(w -h | awk '/:0\.0/ {print $1;exit}') Thanks ! Franck

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

Postby gazelle » Thu, 16 Aug 2007 15:45:54 GMT

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?


Re: (Somewhat OT) How to fix backspace/delete key in OS/X (Mac)

Postby Bill Marcum » Thu, 16 Aug 2007 23:04:58 GMT

On Wed, 15 Aug 2007 06:45:54 +0000 (UTC), Kenny McCormack 


Does the OSX terminal offer any choice as to what terminal it emulates?


-- 
Now, let's SEND OUT for QUICHE!!

Re: (Somewhat OT) How to fix backspace/delete key in OS/X (Mac)

Postby gazelle » Sat, 18 Aug 2007 22:52:28 GMT

In article < XXXX@XXXXX.COM >,




Fixed.  Just go into Terminal/WindowSettings/Keyboard and click "Delete
key sends backspace".  Simple solution, but I think the configuration
screens (variously called Options, Preferences, Window Settings, and
gosh knows what else in various applications) is pretty obscure.


Similar Threads:

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

In article < XXXX@XXXXX.COM >,
Bill Marcum  < XXXX@XXXXX.COM > wrote:
>On Wed, 15 Aug 2007 06:45:54 +0000 (UTC), Kenny McCormack 
>  < XXXX@XXXXX.COM > wrote:
>>
>>
>> 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?
>>
>Does the OSX terminal offer any choice as to what terminal it emulates?

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.

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. Delete key insert "~" on ssh & other OS

7. [OT] Trying to change my OS from Windows to Linux/Mac

8. [OT] Mac OS X



Return to unix

 

Who is online

Users browsing this forum: No registered users and 15 guest