LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Password
Solaris / OpenSolaris This forum is for the discussion of Solaris and OpenSolaris.
General Sun, SunOS and Sparc related questions also go here.

Notices

Reply
 
Search this Thread
Old 03-10-2006, 06:56 AM   #1
thtr2k
Member
 
Registered: Mar 2005
Location: Australia
Posts: 71

Rep: Reputation: 15
please help to make delete key work


can someone please help me? i want to use the backspace key to work as delete in vi, but i've never got it working. I use the "stty erase ^?" to set it but it only does as to backspace. I'm using SunOS.
Thanks in advance
 
Old 03-10-2006, 07:18 AM   #2
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Mint, OL
Posts: 9,500

Rep: Reputation: 355Reputation: 355Reputation: 355Reputation: 355
What do you want exactly to do with delete and/or backspace ?
- under the shell and under vi ?
- with the standard vi or vim ?
- in vi insert-mode or command-mode ?
 
Old 03-10-2006, 07:55 AM   #3
thtr2k
Member
 
Registered: Mar 2005
Location: Australia
Posts: 71

Original Poster
Rep: Reputation: 15
in vi insert-mode. like typing error and able to delete the errors by just pressing the backspace key. thanks

Last edited by thtr2k; 03-10-2006 at 07:56 AM.
 
Old 03-10-2006, 08:44 AM   #4
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Mint, OL
Posts: 9,500

Rep: Reputation: 355Reputation: 355Reputation: 355Reputation: 355
I just tried and both backspace and delete do remove previously entered characters under vi, with your stty setting.

Are you remotely connected from a linux box ?
 
Old 03-10-2006, 08:47 AM   #5
thtr2k
Member
 
Registered: Mar 2005
Location: Australia
Posts: 71

Original Poster
Rep: Reputation: 15
i'm using SunOs, I know that Linux works but with SunOS i'm having this problem
 
Old 03-10-2006, 10:05 AM   #6
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Mint, OL
Posts: 9,500

Rep: Reputation: 355Reputation: 355Reputation: 355Reputation: 355
That wasn't my question.

My question is: are you connecting to the Solaris box remotely from a Linux box ?

By the way SunOS is a bit vague, its first version was launched about 24 years ago.
 
Old 03-27-2006, 01:33 PM   #7
cheesypretzel
LQ Newbie
 
Registered: Mar 2006
Posts: 7

Rep: Reputation: 0
I have a similar problem running SunOS. I'm running on a Linux box so in my user.cshrch I have
stty sane erase '^H' >& /dev/null

So backspace works on Linux. But if I rsh over to a SunOS box my backspace does not work.
 
Old 03-27-2006, 01:39 PM   #8
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Mint, OL
Posts: 9,500

Rep: Reputation: 355Reputation: 355Reputation: 355Reputation: 355
Did you try the same stty command on Solaris ?
The redirection seems to me unnecessary, but doesn't hurt either.
 
Old 03-27-2006, 03:48 PM   #9
cheesypretzel
LQ Newbie
 
Registered: Mar 2006
Posts: 7

Rep: Reputation: 0
Yep after I rsh over I source the user.cshrc
Also tried just typing that line in at the prompt and it seems to have no effect.
 
Old 03-27-2006, 06:07 PM   #10
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Mint, OL
Posts: 9,500

Rep: Reputation: 355Reputation: 355Reputation: 355Reputation: 355
What happens when you use the backspace key in the command line (shell) ?
Does it displays "^H" ?
If true, is the delete key erasing characters or displaying "^?" ?
 
Old 03-28-2006, 08:54 AM   #11
cheesypretzel
LQ Newbie
 
Registered: Mar 2006
Posts: 7

Rep: Reputation: 0
You just made me answer my own question, sorry for my retardedness!!
Over on Sun I was getting the ^? instead of ^H, so obviously the same line won't fix it for both. I put an if/else statement in my user.cshrc to change the ^H to ^? if system is Sun.
Thanks
 
Old 03-28-2006, 11:23 AM   #12
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Mint, OL
Posts: 9,500

Rep: Reputation: 355Reputation: 355Reputation: 355Reputation: 355
Okay, I understand now, you are using JDS gnome-terminal which has an obnoxious option that allows to fool the system:
Terminal / Current Profile / Compatibility
default value of:
"Backspace" send "Delete", and
"Delete" send "<esc>[3~"

I don't know who had the stange idea to mess with these keys, but anyway, it's easy to set the key to their regular behaviour and fix the problem.

After that, you can bring your .cshrc back to its previous settings, which is better, as other terminals like xterm, dtterm, rxvt, kterm and others are not affected.
 
Old 03-28-2006, 04:10 PM   #13
cheesypretzel
LQ Newbie
 
Registered: Mar 2006
Posts: 7

Rep: Reputation: 0
Well, I'm actually using Konsole (I have rather limited system control as this is a company computer) as I am running KDE on an archaic version of Redhat. I guess it has a similar type of option?
 
Old 03-29-2006, 12:21 AM   #14
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Mint, OL
Posts: 9,500

Rep: Reputation: 355Reputation: 355Reputation: 355Reputation: 355
I'm confused, I was thinking you were experiencing this problem only when on Solaris.
Is your kconsole running on Linux or Solaris ?
Try launching "/usr/openwin/bin/xterm&" when connected on Solaris, and see how the keys behave.
Run too:
Code:
xmodmap -pk | egrep "(Delete|BackSpace)"
to see what X11 sends.
 
Old 03-30-2006, 08:37 AM   #15
cheesypretzel
LQ Newbie
 
Registered: Mar 2006
Posts: 7

Rep: Reputation: 0
I'm on Linux, but using rlogin to get to a Solaris box.
It's ok I fixed up my user.cshrc so the backspace works in both environments now.

I was just curious if Konsole had that similar "obnoxious option that allows to fool the system"

No worries though, thanks for your help
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Delete text between key words : sed shalomajay Programming 7 05-11-2011 06:22 PM
Jed editor and delete key tw001_tw Slackware 4 02-01-2005 10:29 PM
The program Screen, "delete" key doesn't work TroelsSmit Linux - Newbie 0 10-13-2004 07:55 AM
mapping delete key sboyce57 Linux - Newbie 1 02-22-2004 11:05 PM
Delete Key in Shell gh0ul Linux - Newbie 1 10-07-2003 10:58 AM


All times are GMT -5. The time now is 11:48 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration