Slackware This Forum is for the discussion of Slackware Linux.
|
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
|
10-21-2014, 03:21 PM
|
#1
|
Senior Member
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442
Rep:
|
Striking End key within vim prints 'F' (GUI terminal).
Slackware 14.0-32
Hi: from within a virtual console (the consoles given the user just after booting slackware), if I run vim and press the End key the result is the same as pressing $ in command mode (cursor goes to end of line). The same sequence of events started from a GUI terminal gets an 'F' printed. I tried this escape sequence in ~/.inputrc:
Code:
"\e[4~": end-of-line # End key
but the shell does not even read that file when I start a terminal in the GUI. Any known solution, assuming this is a problem? Does vim read the same init files when running from the GUI as when running from a virtual console?
|
|
|
10-21-2014, 03:38 PM
|
#2
|
Senior Member
Registered: Jul 2007
Distribution: Slackware64-14.1
Posts: 2,367
|
If you add this to .bashrc it should read .inputrc:
Code:
export INPUTRC=~/.inputrc
I believe the problem is in the terminfo files, which may be non-existent or poorly written for your particular terminal emulator (but don't quote me on that).
|
|
|
10-21-2014, 03:58 PM
|
#3
|
Senior Member
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442
Original Poster
Rep:
|
Still printing 'F'. If I say bash does not read ~/.inputrc it's only because writing junk in it I don't get an error when starting a terminal from the GUI, but that's not correct, as opening a virtual console does not give an error either.
|
|
|
10-21-2014, 04:23 PM
|
#4
|
Senior Member
Registered: Jul 2007
Distribution: Slackware64-14.1
Posts: 2,367
|
in the terminal should tell you if the variable was properly exported. If you are using a login shell in X (for shame) then it won't be sourced unless you have something like this in .bash_profile:
Code:
if [ -e ~/.bashrc ]; then
. .bashrc
fi
If the variable *is* properly exported when you open a new terminal, and it still doesn't work, then I don't know what else to say.
[edit] Actually that line should already be in /etc/inputrc which bash should automatically source...see this thread for more information, and there is another linked thread there. I haven't read it all.
[edit2] If you're getting F printed then the line you want is this one I think:
Code:
"\e[F": end-of-line
...or maybe
Code:
"\eOF": end-of-line
or just
??
Last edited by T3slider; 10-21-2014 at 04:30 PM.
|
|
|
10-21-2014, 04:36 PM
|
#5
|
Senior Member
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442
Original Poster
Rep:
|
I wrote a /usr/local/bin/bw.sh:
AUX=$TERM
TERM=linux-m
vim $1
TERM=$AUX
and use alias vim=/usr/local/bin/bw.sh in /etc/profile, so that vim runs with TERM=linux-m (m stands for monochrome) in the GUI. So the stated problem vanishes if I start vim as which undoes the alias when running from the GUI. Until I find a more straightforward solution I'll keep using this.
Last edited by stf92; 10-21-2014 at 04:41 PM.
|
|
|
10-21-2014, 04:44 PM
|
#6
|
Senior Member
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442
Original Poster
Rep:
|
Sorry, I didn't read your post. TERM is set to '/etc/inputrc', where I have the escape sequences, to no avail. But I wrote above what was happening.
|
|
|
10-21-2014, 06:22 PM
|
#7
|
LQ Guru
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552
|
maybe a weird key mapping from X?
What value do you have for keycode and keysym when running xev in gui terminal and pressing the end key?
|
|
|
10-21-2014, 07:33 PM
|
#8
|
Senior Member
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442
Original Poster
Rep:
|
115, 0xff57. But the keyboard mapping works at a low level, and the key is trapped by higher level software. Please remember TERM=linux-m is the immediate cause of the problem here.
|
|
|
10-21-2014, 08:11 PM
|
#9
|
LQ Guru
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552
|
Is it the same with any X terminal, xterm, rxvt, konsole...?
|
|
|
10-21-2014, 08:36 PM
|
#10
|
Senior Member
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442
Original Poster
Rep:
|
xterm and konsole have the same problem as described. rxvt works nicely in this respect.
|
|
|
10-21-2014, 08:39 PM
|
#11
|
LQ Guru
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552
|
Maybe $TERM is set differently in rxvt? try echo $TERM in those x terminals to see
|
|
|
10-21-2014, 08:42 PM
|
#12
|
Member
Registered: Nov 2003
Posts: 528
Rep:
|
Quote:
Originally Posted by stf92
I wrote a /usr/local/bin/bw.sh:
AUX=$TERM
TERM=linux-m
vim $1
TERM=$AUX
and use alias vim=/usr/local/bin/bw.sh in /etc/profile, so that vim runs with TERM=linux-m (m stands for monochrome) in the GUI. So the stated problem vanishes if I start vim as which undoes the alias when running from the GUI. Until I find a more straightforward solution I'll keep using this.
|
You can't do that. The linux-m terminal type is not compatible with X terminals - it is only for the virtual consoles. The escape sequences are different. For the END key, linux-m tells vim to expect Esc-[4~, but the X terminal is actually sending Esc-OF (that last F is what you are seeing when vim and the libraries don't understand the sequence).
|
|
|
10-22-2014, 05:26 AM
|
#13
|
Member
Registered: Jul 2007
Location: Nottingham, UK
Distribution: Slackware64-current
Posts: 93
Rep:
|
Vim doesn't use ~/.inputrc or /etc/inputrc as its initiation file it uses ~/.vimrc. The END key works ok for me in vim (console and gui). Try putting this line in your ~/.vimrc file:-
|
|
|
10-22-2014, 12:17 PM
|
#14
|
Senior Member
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442
Original Poster
Rep:
|
Quote:
Originally Posted by keefaz
Maybe $TERM is set differently in rxvt? try echo $TERM in those x terminals to see
|
No, TERM= xterm in rxvt as well as in Terminal 0.4.8 (/usr/bin/Terminal, from the Xfce suite), which is the terminal I use on the GUI.
Trying to see if X is running by script, I wrote
Code:
#!/bin/sh
#### WATCH THE ARGUMENT TO ps IS asdf, NON EXISTING PROCESS.
VAR1="$( /bin/ps -C asdf )" #VAR1 gets the text output from /bin/ps
echo $VAR1
echo END
# echo outputs to stdout, grep takes input from stdout. Last command
# in the pipe gives ? its exit code.
echo $VAR1 | grep X
# print grep exit code, 0= 'X' found, 1= 'X' not found, else= error.
echo "exit code= $?"
# So far so well. As asdf is not running, I expect the if echoing
# 'Xnotrunning'. But it'll output 'Xisrunning'! However the printed
# exit code was 1.
if [ $? -eq 0 ]
then
echo Xisrunning
else
echo Xnotrunning
fi
exit
But there is something with the [ xxxx -eq xxxx ] that won't work, as the code above will show. May I ask why
Last edited by stf92; 10-22-2014 at 12:21 PM.
|
|
|
10-22-2014, 12:24 PM
|
#15
|
LQ Guru
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552
|
You're testing previous command which is echo "exit code= $?"
Last edited by keefaz; 10-22-2014 at 12:28 PM.
|
|
1 members found this post helpful.
|
All times are GMT -5. The time now is 07:07 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|