LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 04-21-2011, 03:17 PM   #1
sharky
Member
 
Registered: Oct 2002
Posts: 569

Rep: Reputation: 84
"Insert" & "Delete" key returns "~" in a terminal.


This is making me nuts because I do a lot of command line stuff.

In a terminal, any terminal (I've tried konsole and xterm), pressing the "Insert" or "Delete" key returns a tilde "~" character. This only happens in my account. If I log in to a different account, in the same terminal, the delete key actually deletes characters and makes editing of commands much easier. I have no idea why it behaves in other accounts and not mine. The dot files are all identical.

For a while this was happening with the "Home", "End", and "Page Up/Down" keys. I blew away my .kde directory and it fixed all except the "Delete" and "Insert" keys. I don't really care about the "Insert" key but I really need "Delete" to function as a delete.
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 04-21-2011, 04:14 PM   #2
PhoenixAndThor
Member
 
Registered: Sep 2009
Location: Geogia, USA
Distribution: Ubuntu, Debian, Live CDs
Posts: 213

Rep: Reputation: 39
Question Need more information

I have experienced similar problems like this, but first, please be clear about which desktop (KDE 3.x, KDE 4.x, etc) you are using, what distribution you are running (Debian, Fedora, etc), and what kind of system you are having the problem on (desktop, laptop, other?).

Sometimes it could be the keyboard you are using. Try switching out keyboards (unless you are on a laptop).
 
Old 04-21-2011, 04:57 PM   #3
Telengard
Member
 
Registered: Apr 2007
Location: USA
Distribution: Kubuntu 8.04
Posts: 579
Blog Entries: 8

Rep: Reputation: 148Reputation: 148
Until you figure out a solution here are some work-arounds you may find useful.

Ctrl+D = delete character under cursor
Alt+D = delete from cursor to end of word
Ctrl+K = kill from cursor to end of line
Ctrl+u = kill from cursor to start of line
Ctrl+_ = undo last deletion
Ctrl+Y = replace last killed text

Many more exist.
 
Old 04-21-2011, 05:27 PM   #4
impert
Member
 
Registered: Feb 2009
Posts: 282

Rep: Reputation: 54
Quote:
This only happens in my account. If I log in to a different account, in the same terminal, the delete key actually deletes characters and makes editing of commands much easier. I have no idea why it behaves in other accounts and not mine. The dot files are all identical.
Why not make a new user and either work from that account or copy whatever you cherish to that account, delete your own account, re-make your own account, and copy all your files back.
 
Old 04-21-2011, 07:00 PM   #5
PhoenixAndThor
Member
 
Registered: Sep 2009
Location: Geogia, USA
Distribution: Ubuntu, Debian, Live CDs
Posts: 213

Rep: Reputation: 39
Thnx Telengard, I didn't know about those keybindings. And impert, I think thats exactly what we want to avoid, but it will still wok.
 
Old 04-22-2011, 05:06 AM   #6
impert
Member
 
Registered: Feb 2009
Posts: 282

Rep: Reputation: 54
Quote:
And impert, I think thats exactly what we want to avoid, but it will still wok.
To me it just seems like the easiest way, but whatever.
Surely if it's not happening in the other accounts, it's got to be to do with a dot file in the account where he has the trouble?
 
Old 04-23-2011, 12:26 AM   #7
PhoenixAndThor
Member
 
Registered: Sep 2009
Location: Geogia, USA
Distribution: Ubuntu, Debian, Live CDs
Posts: 213

Rep: Reputation: 39
True. Another thing, why is the "dot-hierarchy" in a typical user's home folder so complicated? When problem like this one occurs, I sometimes spend hours trying to find the culprit. It's a good thing I always back up everything.
 
Old 04-23-2011, 12:11 PM   #8
KDHofAvalon
Member
 
Registered: Apr 2007
Location: Kansas
Distribution: Slackware
Posts: 48

Rep: Reputation: 28
I had a problem like this just recently with my laptop, the Home and End keys were inserting tildes in the terminal. Theres a simple way to fix it though, assuming it's actually the same problem. First, post the contents of your /etc/inputrc and (if it exists) ~/.inputrc for the account having the problem, then run
Code:
cat
in a terminal exactly like I wrote it there, without any parameters. Now press delete, then enter, then insert, then CTRL+D twice and post the output of that as well. If it's the same problem I was having we'll have it fixed in no time.

Last edited by KDHofAvalon; 04-23-2011 at 12:13 PM.
 
Old 04-25-2011, 10:29 AM   #9
sharky
Member
 
Registered: Oct 2002
Posts: 569

Original Poster
Rep: Reputation: 84
Quote:
Originally Posted by KDHofAvalon View Post
I had a problem like this just recently with my laptop, the Home and End keys were inserting tildes in the terminal. Theres a simple way to fix it though, assuming it's actually the same problem. First, post the contents of your /etc/inputrc and (if it exists) ~/.inputrc for the account having the problem, then run
Code:
cat
in a terminal exactly like I wrote it there, without any parameters. Now press delete, then enter, then insert, then CTRL+D twice and post the output of that as well. If it's the same problem I was having we'll have it fixed in no time.
That's it. I removed ~/.inputrc and it fixed the problem! thx,
 
Old 04-25-2011, 02:45 PM   #10
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
@KDHofAvalon: I have exactly the same problem on Slackware -current with zsh. But I don't have ~/.inputrc. Would you be so kind to share your solution, so that I can try if that helps?
 
Old 04-26-2011, 12:57 AM   #11
KDHofAvalon
Member
 
Registered: Apr 2007
Location: Kansas
Distribution: Slackware
Posts: 48

Rep: Reputation: 28
@Sharky: You're quite welcome.

@TobiSGD: Certainly. Slackware's where I had the problem as well.

You should have an '/etc/inputrc' file, even without one in ~, since Slackware installs it by default. DO NOT delete this file as it's referenced at least two times in other default Slackware scripts, once in '/etc/profile' and again... I forget the other one at the moment, sorry.

Anyway the file lists the wrong symbols for the keys that are misbehaving, so you're going to have to edit it. Use my instructions for 'cat' in my last post and press the misbehaving keys one at a time. The result will look something like this:
Code:
^[[8~
And a sample from my '/etc/inputrc':
Code:
"\e[1~": beginning-of-line
"\e[4~": end-of-line
"\e[5~": beginning-of-history
"\e[6~": end-of-history
"\e[7~": beginning-of-line
"\e[3~": delete-char
"\e[2~": quoted-insert
Simply replace the number of the proper function with the one you got with 'cat' and you're done.

Hope that helps.

Last edited by KDHofAvalon; 04-26-2011 at 01:00 AM.
 
2 members found this post helpful.
Old 04-26-2011, 01:47 AM   #12
PhoenixAndThor
Member
 
Registered: Sep 2009
Location: Geogia, USA
Distribution: Ubuntu, Debian, Live CDs
Posts: 213

Rep: Reputation: 39
Wow, I'm bookmarking this. Even though I've never had a problem like this, I am thinking about trying Slackware soon and this is exactly the kind of info I need.
 
Old 04-26-2011, 06:07 AM   #13
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
Thanks for your explanation, but sadly, that didn't help me.
This is the content of my /etc/inputrc:
Code:
# /etc/inputrc
# This file configures keyboard input for programs using readline.
# See "man 3 readline" for more examples.

# Configure the system bell.  Options are none, visible, and audible.
#set bell-style none

# Enable 8 bit input.
set meta-flag On
set input-meta On
set convert-meta Off
set output-meta On

# Set various nice escape sequences:
"\eOd": backward-word
"\eOc": forward-word

# for linux console
"\e[1~": beginning-of-line
"\e[4~": end-of-line
"\e[5~": beginning-of-history
"\e[6~": end-of-history
"\e[3~": delete-char
"\e[2~": quoted-insert

# for xterm
"\eOH": beginning-of-line
"\eOF": end-of-line



# for freebsd console
"\e[H": beginning-of-line
"\e[F": end-of-line
These keys (with the code the cat command gives) are not working for me in the console, regardless of it is a xterm or a virtual console.
Code:
Delete:       ^[[3~
Insert:       ^[[2~
Page up:      ^[[5~
Page down:    ^[[6~
Home:         ^[OH    on virtual console this is ^[[1~
End:          ^[OF    on virtual console this is ^[[4~
I am somewhat lost here, because the keys I press are the same that are mentioned in the inputrc, but it is not working.
 
Old 04-26-2011, 07:30 AM   #14
KDHofAvalon
Member
 
Registered: Apr 2007
Location: Kansas
Distribution: Slackware
Posts: 48

Rep: Reputation: 28
Okay I just realized the problem. I use bash while you use zsh, which apparently doesn't read '/etc/inputrc'. Alright, then we'll have to convert the key definitions for bindkey and put them in your ~/.zshrc, easy enough just put bindkey at the start and get rid of the colon. Or if you prefer here's a sed one-liner to get them into the right format:
Code:
sed -n 's/^/bindkey /; s/: / /p' /etc/inputrc
Sorry about that, I've never used zsh extensively.
 
1 members found this post helpful.
Old 04-26-2011, 07:37 AM   #15
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
That works, thanks for your help.
 
  


Reply

Tags
keybindings, keyboard



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
automount 5.0.3 with auto.smb script yields "key "<name>" not found in map" rbergen Linux - Software 0 01-01-2010 12:27 PM
Command "mail" returns "panic: temporary file seek" kenneho Linux - Software 5 12-23-2008 03:27 AM
net working eth0 eth1 wlan0 "no connection" "no LAN" "no wi-fi" Cayitano Linux - Newbie 5 12-09-2007 07:11 PM
Standard commands give "-bash: open: command not found" even in "su -" and "su root" mibo12 Linux - General 4 11-11-2007 10:18 PM
LXer: Displaying "MyComputer", "Trash", "Network Servers" Icons On A GNOME Desktop LXer Syndicated Linux News 0 04-02-2007 08:31 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 07:20 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration