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.

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

2 Answers 2


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.

  • 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 >.< Commented Apr 26, 2012 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 $@

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .