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

Notices


Reply
  Search this Thread
Old 09-04-2013, 05:12 PM   #1
sadarax
Member
 
Registered: Sep 2005
Distribution: Ubuntu
Posts: 252

Rep: Reputation: 30
GNU Screen Caption Display Problem


I just installed Fedora 19 and tried running GNU screen. I've been using the same screenrc file for years now and something is suddenly changed. (It previously worked correctly on Fedora 18 and has worked on Redhat, Debian and Ubuntu for years as well.)

This is my screenrc caption line:
hardstatus alwayslastline
hardstatus string '%{= g}[ %{G}%H %{g}]%{W}%L= %-Lw%{r}(%{W}%n*%50L>%t%{r})%{W}%+Lw%-0=%{g}'


It should display something like this:

[ host1 ] 0$ (1*) 2- 3$


Now it incorrectly displays the hostname:fullpath, which is wrong.

[ host1 ] 0- root@host1:~ (1*john@host1:~/code/scripts/system)

I've tried fixing this but I'm honestly not sure what went wrong or why it's broken.

I just want a very minimal display like this: [ host1 ] 0$ (1*) 2- 3$. No paths and since screen doesn't seem to update the titles for any programs I open (like Vim) within an existing shell, I don't care about the titles.

Help?

Last edited by sadarax; 09-04-2013 at 05:14 PM.
 
Old 11-17-2013, 03:43 PM   #2
vulcan99
LQ Newbie
 
Registered: Nov 2013
Posts: 1

Rep: Reputation: Disabled
Same problem here. I don't know much about all this TERM stuff, but I found what seems to be a solution.

In the file /etc/basrc, it checks the $TERM variable, if it starts with "screen*", it sets a PROMPT_COMMAND variable.

If you change that file to look like:

screen*)
if [ -e /etc/sysconfig/bash-prompt-screen ]; then
PROMPT_COMMAND=/etc/sysconfig/bash-prompt-screen
else
#PROMPT_COMMAND='printf "\033k%s@%s:%s\033\\" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/~}"'
PROMPT_COMMAND=''
fi
;;

Then it should do what you want. At least it did for me. Notice I commented out the original PROMPT_COMMAND line and set it to an empty string.
 
Old 11-17-2013, 11:10 PM   #3
sadarax
Member
 
Registered: Sep 2005
Distribution: Ubuntu
Posts: 252

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by vulcan99 View Post
Same problem here. I don't know much about all this TERM stuff, but I found what seems to be a solution.

In the file /etc/basrc, it checks the $TERM variable, if it starts with "screen*", it sets a PROMPT_COMMAND variable.

If you change that file to look like:

screen*)
if [ -e /etc/sysconfig/bash-prompt-screen ]; then
PROMPT_COMMAND=/etc/sysconfig/bash-prompt-screen
else
#PROMPT_COMMAND='printf "\033k%s@%s:%s\033\\" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/~}"'
PROMPT_COMMAND=''
fi
;;

Then it should do what you want. At least it did for me. Notice I commented out the original PROMPT_COMMAND line and set it to an empty string.
Whoa, thanks man. This fixed the problem completely.
UPDATE: I just found out that you don't need to edit the system configuration files to fix this. Just add the line:

Code:
PROMPT_COMMAND=''
Somewhere into your own bashrc file (typically in ~/.bashrc).

Last edited by sadarax; 11-17-2013 at 11:12 PM.
 
  


Reply

Tags
caption, gnu screen, screenrc


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
GNU Screen status bar and caption bar fakie_flip Linux - Software 0 03-03-2013 06:44 AM
a problem with GNU Screen gat3 Slackware 2 05-18-2011 05:53 PM
is there any software available that decodes & display closed caption 608/708? ayappanc Linux - Software 0 02-05-2009 03:57 AM
Problem withChanging DISPLAY environment variable to display on someone else's screen wantsri Linux - Networking 1 10-25-2005 11:14 AM
program: screen - caption BoudewijnS Linux - Software 0 10-02-2004 01:59 PM

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

All times are GMT -5. The time now is 01:00 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