# Pine and webbrowsing.

## evoweiss

Hi all,

I'm hopelessly happy with pine as my email client, but I am trying to solve one minor problem I am having with it.

If there's a link to some website in pine and I press enter to see it, it brings up the website, but pine freezes up and I can't use it again until I close the browser. Is there a way to configure pine so that it will simply spawn the webbrowser with said address and go on its merry way?

Best,

Alex

----------

## kallamej

I cannot reproduce this. I have the following settings.

```
[X]  enable-msg-view-urls

url-viewers = /usr/bin/firefox
```

----------

## evoweiss

 *kallamej wrote:*   

> I cannot reproduce this. I have the following settings.
> 
> ```
> [X]  enable-msg-view-urls
> 
> ...

 

I have the following:

```
url-viewers=_TEST("test -n '${DISPLAY}'")_ /usr/kde/3.3/bin/konqueror,

        "/usr/bin/links2 _URL_"

```

As I obviously use konqueror and I also want to be able to view stuff via links2 if I am accessing the computer remotely. However, as stated before, if I click on a link pine suspends and I can do nothing until I've closed konqueror. In addition, some setting changed and I can't view stuff anymore with links2 from remote terminals, the screen goes blank until I hit control-c. I suspect the latter problem may be because it's trying to do x forwarding, but I don't know how to disable that.

One additional thing I noticed just now is that, if I am logged in remotely, typing in echo $DISPLAY gives me 

```
xxx.xxx.xxx.xxx:0:0
```

 where the series of xxxs is the IP address of the system I am using to access my computer remotely.

Does any of this help you (or anybody else) figure out why I am having this minor problem?

Best,

Alex

----------

## kallamej

I can't test this with konqueror to see if it behaves differently, but the other problem seems to be related to DISPLAY being set when logged in remotely. There has been some changes back and forth in pam lately affecting that setting. Don't know if it's related to X forwarding. You can check the settings in /etc/ssh/sshd_config on the server and ssh_config on the client.

----------

## evoweiss

Hi,

 *kallamej wrote:*   

> I can't test this with konqueror to see if it behaves differently, but the other problem seems to be related to DISPLAY being set when logged in remotely. There has been some changes back and forth in pam lately affecting that setting. Don't know if it's related to X forwarding. You can check the settings in /etc/ssh/sshd_config on the server and ssh_config on the client.

 

Hmmmm... what should the value of display ideally be? I noticed that X11 forwarding was disabled in sshd_config. Should that be switched on?

Alex

----------

## kallamej

Unless you need to forward X applications it shouldn't be turned on. Since my last pam upgrade, DISPLAY is set (again) to localhost:10.0. It was remote-host:0.0 for a while though. But that is all with X forwarding turned on. If I turn it off, DISPLAY is not set. You may want to check your /etc/security/pam_env.conf. I have

```
REMOTEHOST      DEFAULT= OVERRIDE=@{PAM_RHOST}

DISPLAY         DEFAULT= OVERRIDE=@{DISPLAY}
```

----------

## evoweiss

 *kallamej wrote:*   

> Unless you need to forward X applications it shouldn't be turned on. Since my last pam upgrade, DISPLAY is set (again) to localhost:10.0. It was remote-host:0.0 for a while though. But that is all with X forwarding turned on. If I turn it off, DISPLAY is not set. You may want to check your /etc/security/pam_env.conf. I have
> 
> ```
> REMOTEHOST      DEFAULT= OVERRIDE=@{PAM_RHOST}
> 
> ...

 

Thanks, I'll give that a try. I won't be logging in remotely over the weekend, so I'll have to wait and find out whether it worked later.

Alex

----------

## qanuta

I have this handy little script which I use to add the url (I use urlview/mutt) to a tab in a running konqueror, or start a fresh konqueror if one doesn't exist:

```
#!/bin/bash

konqps=`ps -C konqueror -o pid=`

konqps=`printf 'konqueror-%s' $konqps`

dcop $konqps konqueror-mainwindow#1 newTab $1 || (konqueror $1 &)

```

I call it with urlview and the following config in .urlview:

```
COMMAND misc/tabkonq %s
```

You should be able to call it from anywhere though.   It either sends a signal to an exisitng konqueror (nearly instantaneous), or spawns a new browser with &, so wither way it should return very quickly.

----------

## evoweiss

 *qanuta wrote:*   

> I have this handy little script which I use to add the url (I use urlview/mutt) to a tab in a running konqueror, or start a fresh konqueror if one doesn't exist:

 

Wow, that's really cool and it works like a charm. Thanks a bunch!

Best,

Alex

----------

## evoweiss

Heh... spoke a wee too soon. If there's no browser open then it doesn't open konqueror, just looks like nothing happened. However, when I do open a browser it pops up with the right url open. Any idea why this might be?

Anyway, this is still a huge improvement.

Alex

----------

## qanuta

Hrmm.   That's strange.  I haven't encountered that before.  An experiment might be to make a second script which just has the "konqueror $1 &" bit and see if that works or not. 

If that spawns a new browser, then for some reason dcop is returning success even though it failed.  In that case I'm at a loss.  If it doesn't spawn a new browser, then for some reason it can't find konqueror.  Perhaps fully pathing to konqueror would help? ("/usr/kde/3.3/bin/konqueror $1 &").

That's it; I'm out of ideas....

----------

## evoweiss

Hi,

 *qanuta wrote:*   

> Hrmm.   That's strange.  I haven't encountered that before.  An experiment might be to make a second script which just has the "konqueror $1 &" bit and see if that works or not. 
> 
> If that spawns a new browser, then for some reason dcop is returning success even though it failed.  In that case I'm at a loss.  If it doesn't spawn a new browser, then for some reason it can't find konqueror.  Perhaps fully pathing to konqueror would help? ("/usr/kde/3.3/bin/konqueror $1 &").
> 
> That's it; I'm out of ideas....

 

I tried both ideas and had no luck, but I ran the script one line at a time to try and see what was happening and think I see why the problem is coming up. I'm running KDE (not sure if you are or not) and there's always a konqueror process running. Hence, it will think a copy of konqueror is already open and, hence, won't start a fresh one. Know of any way to modify the script so this is taken into account?

Best,

Alex

----------

## qanuta

Well, the first two lines of the script just try to identify running konquerors and put the information in the correct form into the variable konqps.  The real action is the third line which calls dcop to send a command to this running konqueror, and if it fails, just start up a new konqueror.

You might look to see if konqps looks reasonable or if it's crazy somehow.

----------

## evoweiss

 *qanuta wrote:*   

> Well, the first two lines of the script just try to identify running konquerors and put the information in the correct form into the variable konqps.  The real action is the third line which calls dcop to send a command to this running konqueror, and if it fails, just start up a new konqueror.
> 
> You might look to see if konqps looks reasonable or if it's crazy somehow.

 

Well, figured out what the problem was. Konqueror was set so that one instance would be kept running even after it was closed. As a result, when it was closed, your script thought it was open and sent the command. I changed the setting and it seems to be working well now.

Best,

Alex

----------

## qanuta

Glad it's working for you.  I'm no bash scripting guru, and those silly three lines took me more time to write than I care to admit.  So I'm glad someone else can benefit from them too.

----------

## evoweiss

Hi there,

I'll hope to re-open this thread namely as I'm now using firefox as my principle browser and something isn't working anymore. Basically, I have the following command under pine's url-viewers option:

```
url-viewers=_TEST("test -n '${DISPLAY}'")_ "/usr/bin/firefox" ,

        "/usr/bin/links2 _URL_"
```

This worked fine until a recent update of firefox. Now what happens is firefox opens, but the window in which pine is running is suspended until firefox is closed. Is there some way to force firefox into the background?

Best,

Alex

----------

## kallamej

Late answer, or observation rather. That happens for me as well if firefox is not already running. Haven't bothered to investigate as I typically always have firefox running.

----------

## ppurka

Simply point it to a script which backgrounds firefox. This is mentioned earlier in thread too.

----------

