Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

The title pretty much says it all.

When I run the viewer command in alpine from within GNU screen it tells me "viewer command completed" but it doesn't actually bring up Lynx (or any other viewer). I even tried writing my own script that would just write the arguments out to a file and no dice. I tried piping the message to a file, and I get "Can't exec (script) no such file or directory"

However, if I close out alpine, detach from screen, and then start alpine, I can use the viewer or pipe messsages just fine.

So, what is the problem here and how can I fix it?

Update 1:

The value of TERM depends on what I login with - from Eterm on my laptop, TERM is Eterm outside of screen and screen inside. From Connect Bot it's screen attached or not.

And here is my .screenrc

$ cat .screenrc 
defscrollback 10000
caption always "%?%F%{-b bc}%:%{-b bb}%?%C|%D|%M %d|%H%?%F%{+u wb}%? %L=%-Lw%45>%{+b by}%n%f*%t%{-}%+Lw%-0<"

shell bash

bind j focus down
bind k focus up
bind t focus top
bind b focus bottom

screen -t 'system'
screen -t 'alpine'
screen -t 'programming' 
screen -t 'suppliments' 
screen -t 'ssh'
screen -t 'webby'
screen -t 'ipython' ipython
screen -t 'mpg321'
screen -t 'irssi' 

Update 2: Changing the term value didn't fix anything. I tried tmux for a while, and that actually worked, but I had some issues with it properly sizing based on what screen I was using (whatever the smallest dimension was).

So now I'm using a somewhat strange hack - I run a tmux session inside my screen session and run alpine inside that tmux session. Viewing URLs works perfectly fine now, but obviously this is not the ideal situation, and I'd welcome any better fixes.

share|improve this question
    
What is the value of TERM environment variable in and out of screen? Have you a ~/.screenrc, and what contain? Update your question. –  enzotib Feb 9 '12 at 11:40
    
@enzotib, updated! It doesn't seem like it'll be much help... –  Wayne Werner Feb 10 '12 at 2:17
    
Try some different values for $TERM: $ TERM=xterm command, $ TERM=vt100 command, ... –  Keith Thompson Feb 10 '12 at 3:08
    
Changing the term type had no effect, sadly –  Wayne Werner Feb 10 '12 at 12:31
    
Looks like it works from inside tmux. So now it's a multiplexer within a multiplexer! –  Wayne Werner Apr 19 '12 at 14:16

2 Answers 2

up vote 1 down vote accepted

It looks like you are hard-coding your shell in the .screenrc to bash, is that your login shell as well? Try commenting out that line and trying.

Failing that, compare the value of your $PATH from outside of tmux/screen, from inside screen, and from inside of tmux? If nothing jumps out from there, compare the output of env from all three setups.

share|improve this answer
    
Honestly I don't remember why I was doing that - I thought that I had done it because I was having this problem, but it probably just "came along" from wherever I started my .screenrc. The unanswered question (for me) remains - why? env and $PATH produced the same output, bash is my shell (as set in /etc/passwd), and as far as I've been able to discern everything else was identical. Except piping a command from alpine >.< –  Wayne Werner Apr 26 '12 at 11:59

I do something similar to what the OP seems to need. I have alpine check to see whether I am using it locally or remotely via screen. If it's remote, I use screen to open a script that calls elinks, and if it's local (i.e. anything else), I use firefox to open the URL.

In .pinerc:

url-viewers=_TEST("test '${TERM}' = screen-bce")_ "/usr/bin/screen screlinks _URL_", "/usr/bin/firefox _URL_"

The script I call "screlinks" checks if there's a running elinks already and if so uses the -remote option to open a new tab.

running='elinks -remote ping()'
if $running
then # echo "elinks running"
  /usr/bin/elinks -remote $@
else # echo "elinks not running"
  /usr/bin/elinks $@
fi

The end result is that when I'm using alpine in screen and I open a URL, I get a new screen process that runs elinks. I can switch there using the appropriate ^A command, and close it when I'm done or leave it open and add extra URLs as tabs.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.