LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 10-22-2014, 01:00 PM   #16
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Original Poster
Rep: Reputation: 76

Thanks, keefaz. Bugs happen all the time! I now see I made a lot of work without giving proper thinking to the overall process. I intended to decide whether to invoke vim with or without TERM=linux-m with the final if in the script:

Code:
if [ $? -eq 0 ]
then
    ## TERM=linux-m, call vim, restaure TERM

else
    ## Xnotrunning, call vim.
fi
exit
Wrong! I should ask FROM WHERE I am invoking vim, if from a vc (virtual console) or from /usr/bin/Terminal, which is an X application. But it was an exercise after all.
 
Old 10-22-2014, 02:03 PM   #17
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Original Poster
Rep: Reputation: 76
The solution was straightforward.
Code:
bill@server:/usr/local/bin$ cat bw.sh
#!/bin/sh

if [ $PPID -eq 1 ]
then
    # Do this for the linux console (virtual terminals)
    AUX=$TERM
    TERM=linux-m
    vim $1
    TERM=$AUX
else
    # I am in the GUI
     vim $1
fi
bill@server:/usr/local/bin$
 
  


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
[SOLVED] The Home and End keys in vim under the GUI terminals. stf92 Slackware 9 12-07-2013 07:39 PM
gui read out of back end command lines from gui front end activation? how? Siljrath Linux - General 0 10-24-2008 10:11 AM
vim: rich ("gui") colorschemes in a terminal emulator? prell Linux - Software 13 09-10-2008 10:07 AM
VIM Users: Do you use VIM via console or gui? JMJ_coder Linux - General 48 04-16-2008 03:12 AM
rxvt prints ~ on home/end keypress mpn Linux - General 2 10-17-2004 04:18 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 09:01 PM.

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