Re: urlview - open firefox tab
On Thu, Feb 26, 2009 at 02:09:06PM -0700, Joseph wrote: > I have ./home/me/.urlview > REGEXP (((http|https|ftp|gopher)|mailto)[.:][^ >"\t]*|www\.[-a-z0-9.]+)[^ > .,;\t>">\):] > COMMAND firefox -remote openURL\(%s,new-tab\) > > in mutt macros > acro index \cb |urlview\n macro pager \cb |urlview\n > > CTRL-B shows URL's but nothing no new tab appears in firefox when I hit > any url change the COMMAND to COMMAND echo firefox -remote openURL\(%s,new-tab\) and see what the shell actually receives. btw, recent versions of firefox allow a simple 'firefox '. if you have configured ff to open a new page in a new tab rather than a new window, that should give what you want. -- Joost Kremers, PhD University of Frankfurt Institute for Cognitive Linguistics Grüneburgplatz 1 60629 Frankfurt am Main, Germany
Re: urlview - open firefox tab
On 02/26/09 22:53, Joost Kremers wrote: [snip] change the COMMAND to COMMAND echo firefox -remote openURL\(%s,new-tab\) and see what the shell actually receives. btw, recent versions of firefox allow a simple 'firefox '. if you have configured ff to open a new page in a new tab rather than a new window, that should give what you want. I tried: added. "COMMAND echo..." I think I'm getting the correct syntax in shell, eg: URL: www.dentimax.com Firefox 3.0.6 is configured to open new URL in TAB but nothing is happening. -- #Joseph GPG KeyID: ED0E1FB7
Re: urlview - open firefox tab
On 26Feb2009 15:43, Joseph wrote: > On 02/26/09 22:53, Joost Kremers wrote: > [snip] >> change the COMMAND to >> >> COMMAND echo firefox -remote openURL\(%s,new-tab\) >> >> and see what the shell actually receives. >> >> btw, recent versions of firefox allow a simple 'firefox '. if you have >> configured ff to open a new page in a new tab rather than a new window, >> that should give what you want. > > I tried: added. "COMMAND echo..." I think I'm getting the correct syntax in > shell, eg: > URL: www.dentimax.com > > Firefox 3.0.6 is configured to open new URL in TAB but nothing is > happening. It's possible that the brackets are not sufficiently escaped; it depends what is happening to that string on its way to the shell. Has this worked in the past, or is this a new setup? -- Cameron Simpson DoD#743 http://www.cskk.ezoshosting.com/cs/
Re: urlview - open firefox tab
On 02/27/09 10:43, Cameron Simpson wrote: I tried: added. "COMMAND echo..." I think I'm getting the correct syntax in shell, eg: URL: www.dentimax.com Firefox 3.0.6 is configured to open new URL in TAB but nothing is happening. It's possible that the brackets are not sufficiently escaped; it depends what is happening to that string on its way to the shell. Has this worked in the past, or is this a new setup? I think it was working OK with Firefox 2.0 -- #Joseph GPG KeyID: ED0E1FB7
Re: urlview - open firefox tab
On 26Feb2009 16:54, Joseph wrote: > On 02/27/09 10:43, Cameron Simpson wrote: >>> I tried: added. "COMMAND echo..." I think I'm getting the correct syntax in >>> shell, eg: >>> URL: www.dentimax.com >>> >>> Firefox 3.0.6 is configured to open new URL in TAB but nothing is >>> happening. >> >> It's possible that the brackets are not sufficiently escaped; it depends what >> is happening to that string on its way to the shell. >> Has this worked in the past, or is this a new setup? > > I think it was working OK with Firefox 2.0 The next step is to do this by hand at a shell prompt. Try typing: firefox -remote openURL\(www.mutt.org,new-tab\) and see if that works. If it doesn't, that has to be fixed before urlview is worth examining. -- Cameron Simpson DoD#743 http://www.cskk.ezoshosting.com/cs/ All information wants to be free. - an old Hacker's adage
Re: urlview - open firefox tab
On 02/27/09 12:29, Cameron Simpson wrote: It's possible that the brackets are not sufficiently escaped; it depends what is happening to that string on its way to the shell. Has this worked in the past, or is this a new setup? I think it was working OK with Firefox 2.0 The next step is to do this by hand at a shell prompt. Try typing: firefox -remote openURL\(www.mutt.org,new-tab\) and see if that works. If it doesn't, that has to be fixed before urlview is worth examining. firefox -remote openURL\(www.mutt.org,new-tab\) Error: Failed to send command: 500 command not parseable but: firefox -remote 'openURL(http://www.mutt.org,new-tab)' works firefox -remote openURL('http://www.cskk.ezoshosting.com/cs/',new-tab)... sh: -c: line 0: syntax error near unexpected token `(' It seems like it doesn't like the single '' between in URL -- #Joseph GPG KeyID: ED0E1FB7
Re: urlview - open firefox tab
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Thursday, February 26 at 07:32 PM, quoth Joseph: > firefox -remote openURL\(www.mutt.org,new-tab\) > Error: Failed to send command: 500 command not parseable Hmmm, so, perhaps openURL requires the http:// in front? > but: > firefox -remote 'openURL(http://www.mutt.org,new-tab)' > works That's good! > firefox -remote openURL('http://www.cskk.ezoshosting.com/cs/',new-tab)... > sh: -c: line 0: syntax error near unexpected token `(' Well, sure - bare parentheses mean something to your shell. That's why you have to put the backslashes in front of them. It's got nothing to do with the single quotes inside. You could do this: firefox -remote 'openURL('http://www.cskk.ezohosting.com/cs/',new-tab)' and that should work just fine too (though for a slightly different reason). ~Kyle - -- The surest way to corrupt a youth is to instruct him to hold in higher regard those who think alike than those who think differently. -- Nietzsche -BEGIN PGP SIGNATURE- Comment: Thank you for using encryption! iEYEARECAAYFAkmnZcEACgkQBkIOoMqOI16e3gCfQCZhTZIRVCI5Id35171cdpHy 298An2aVbTjWAyNHRrbXMygTKpAPy8Vj =7dt5 -END PGP SIGNATURE-
Re: urlview - open firefox tab
On 26Feb2009 22:02, Kyle Wheeler wrote: | On Thursday, February 26 at 07:32 PM, quoth Joseph: | > firefox -remote openURL\(www.mutt.org,new-tab\) | > Error: Failed to send command: 500 command not parseable | | Hmmm, so, perhaps openURL requires the http:// in front? | | > but: | > firefox -remote 'openURL(http://www.mutt.org,new-tab)' | > works | | That's good! Indeed. The next test step is like this: echo http://www.mutt.org/ | urlview - Does that work? Meanwhile, a look at urlview's manual entry, from "man urlview", suggests your .urlview file is just fine (visually). Cheers, -- Cameron Simpson DoD#743 http://www.cskk.ezoshosting.com/cs/
Re: urlview - open firefox tab
On 02/26/09 22:02, Kyle Wheeler wrote: firefox -remote openURL('http://www.cskk.ezoshosting.com/cs/',new-tab)... sh: -c: line 0: syntax error near unexpected token `(' Well, sure - bare parentheses mean something to your shell. That's why you have to put the backslashes in front of them. It's got nothing to do with the single quotes inside. You could do this: in urlview I have: OMMAND firefox -remote openURL\(%s,new-tab\) When I try to open any URL: Executing: firefox -remote openURL\('http://domainkeys.sourceforge.net/',new-tab\)... Error: Failed to send command: 500 command not parseable -- #Joseph GPG KeyID: ED0E1FB7
Re: urlview - open firefox tab
On 02/27/09 15:32, Cameron Simpson wrote: | That's good! Indeed. The next test step is like this: echo http://www.mutt.org/ | urlview - Does that work? Yes, this works OK; Firefox opens new URL in a tab. I Googling about this error but can not pin point the reason. -- #Joseph GPG KeyID: ED0E1FB7
Re: urlview - open firefox tab
On 26Feb2009 22:23, Joseph wrote: > On 02/27/09 15:32, Cameron Simpson wrote: >> | That's good! >> >> Indeed. The next test step is like this: >> echo http://www.mutt.org/ | urlview - >> Does that work? > > Yes, this works OK; Firefox opens new URL in a tab. Ok, try this in your .urlview file: COMMAND exec >>urlview.out 2>&1; set -x; firefox -remote openURL\(%s,new-tab\) i.e. insert "exec >>urlview.out 2>&1; set -x;" into the front of your COMMAND string. Then use urlview from mutt and examine the urlview.out file afterwards. If we don't learn anything there we can write a small shell script. Cheers, -- Cameron Simpson DoD#743 http://www.cskk.ezoshosting.com/cs/ Without question, the greatest invention in the history of mankind is beer. Oh, I grant you that the wheel was also a fine invention, but the wheel does not go nearly as well with pizza. - Dave Barry
Re: urlview - open firefox tab
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Thursday, February 26 at 10:20 PM, quoth Joseph: > in urlview I have: > OMMAND firefox -remote openURL\(%s,new-tab\) > > When I try to open any URL: > Executing: firefox -remote > openURL\('http://domainkeys.sourceforge.net/',new-tab\)... > Error: Failed to send command: 500 command not parseable I don't use urlview (I use extract_url.pl, which is similar), but it looks like urlview may be stripping the backslashes. I wonder if you can fix it like this: COMMAND firefox -remote 'openURL('%s',new-tab)' If that doesn't fix it, you could even try something stupid like creating a shell script (let's say openfirefox.sh) that looks like this: #!/bin/sh firefox -remote 'openURL('"$1"',new-tab)' ...and then use this in your .urlview file: COMMAND openfirefox.sh %s ~Kyle - -- Reality is that which, when you stop believing in it, doesn't go away. -- Philip K. Dick -BEGIN PGP SIGNATURE- Comment: Thank you for using encryption! iEYEARECAAYFAkmni/kACgkQBkIOoMqOI16xyQCcD27cE2ccxygzjQ/5we6CVdld N2AAoNq32yU75JO7RZDkgzNyf/JUpWx1 =x8GE -END PGP SIGNATURE-
Re: urlview - open firefox tab
On Thu, Feb 26, 2009 at 10:20:22PM -0700, Joseph wrote: > On 02/26/09 22:02, Kyle Wheeler wrote: >> >>> firefox -remote openURL('http://www.cskk.ezoshosting.com/cs/',new-tab)... >>> sh: -c: line 0: syntax error near unexpected token `(' >> >> Well, sure - bare parentheses mean something to your shell. That's why >> you have to put the backslashes in front of them. It's got nothing to >> do with the single quotes inside. You could do this: > > in urlview I have: > OMMAND firefox -remote openURL\(%s,new-tab\) > > When I try to open any URL: > Executing: firefox -remote > openURL\('http://domainkeys.sourceforge.net/',new-tab\)... > Error: Failed to send command: 500 command not parseable i haven't used urlview since i started using xfce4's Terminal, which recognises urls and makes them clickable, but back when i did, my .urlview looked like this: ### # Urlview configuration file. # man urlview # # The defaults are shown here: # REGEXP (((https?|ftp|gopher)://|(mailto|file|news):)[^' \t<>"]+|(www|web|w3)\.[-a-z0-9.]+)[^' \t.,;<>"\):] COMMAND /home/joost/bin/urlhandler.sh %s # ### and the script urlhandler.sh looked like this: == #!/bin/bash export PATH=/usr/bin:/usr/local/bin: if [ ! -z $DISPLAY ] ; then # for some stupid reason, firefox -remote cannot handle the fact that # there are commas in urls. therefore, we have to parse the url through # sed and replace commas with their ascii code %2c: exec firefox -remote "openURL($(echo $@|sed 's/,/%2c/g'),new-tab)" else TERM=linux exec links "$@" fi == however, given that firefox doesn't need the -remote option nor the command openURL anymore, i'd try this in .urlview: COMMAND firefox %s my guess is that'll work just fine... -- Joost Kremers, PhD University of Frankfurt Institute for Cognitive Linguistics Grüneburgplatz 1 60629 Frankfurt am Main, Germany
Re: urlview - open firefox tab
On 02/27/09 17:40, Cameron Simpson wrote: Ok, try this in your .urlview file: COMMAND exec >>urlview.out 2>&1; set -x; firefox -remote openURL\(%s,new-tab\) i.e. insert "exec >>urlview.out 2>&1; set -x;" into the front of your COMMAND string. Then use urlview from mutt and examine the urlview.out file afterwards. If we don't learn anything there we can write a small shell script. I tried as you suggested in urlview: COMMAND exec >>urlview.out 2>&1; set -x; firefox -remote openURL\(%s,new-tab\) response: Executing: exec >>urlview.out 2>&1; set -x; firefox -remote openURL\('http://www.mutt.org/',new-tab\)... -- #Joseph GPG KeyID: ED0E1FB7
Re: urlview - open firefox tab
On Fri, Feb 27, 2009 at 12:24:24PM +0100, Joost Kremers wrote: > On Thu, Feb 26, 2009 at 10:20:22PM -0700, Joseph wrote: > > On 02/26/09 22:02, Kyle Wheeler wrote: > >> > >>> firefox -remote openURL('http://www.cskk.ezoshosting.com/cs/',new-tab)... > >>> sh: -c: line 0: syntax error near unexpected token `(' > >> > >> Well, sure - bare parentheses mean something to your shell. That's why > >> you have to put the backslashes in front of them. It's got nothing to > >> do with the single quotes inside. You could do this: > > > > in urlview I have: > > OMMAND firefox -remote openURL\(%s,new-tab\) > > > > When I try to open any URL: > > Executing: firefox -remote > > openURL\('http://domainkeys.sourceforge.net/',new-tab\)... > > Error: Failed to send command: 500 command not parseable > > i haven't used urlview since i started using xfce4's Terminal, which > recognises urls and makes them clickable, but back when i did, my .urlview > looked like this: > > ### > # Urlview configuration file. > # man urlview > # > # The defaults are shown here: > # > REGEXP (((https?|ftp|gopher)://|(mailto|file|news):)[^' > \t<>"]+|(www|web|w3)\.[-a-z0-9.]+)[^' \t.,;<>"\):] > COMMAND /home/joost/bin/urlhandler.sh %s > # > ### > > and the script urlhandler.sh looked like this: > > == > > #!/bin/bash > > export PATH=/usr/bin:/usr/local/bin: > > if [ ! -z $DISPLAY ] ; then > > # for some stupid reason, firefox -remote cannot handle the fact that > # there are commas in urls. therefore, we have to parse the url through > # sed and replace commas with their ascii code %2c: > > exec firefox -remote "openURL($(echo $@|sed 's/,/%2c/g'),new-tab)" > else > TERM=linux > exec links "$@" > fi > > == > > however, given that firefox doesn't need the -remote option nor the command > openURL anymore, i'd try this in .urlview: > > COMMAND firefox %s > > my guess is that'll work just fine... I use Cygwin ion a laptop for mail, with mutt of course, and:- COMMAND "/cygdrive/c/Program Files/Mozilla Firefox/firefox" %s in my .urlview works fine, so you are certainly correct if firefox is on your path. Brian. > > -- > Joost Kremers, PhD > University of Frankfurt > Institute for Cognitive Linguistics > Gr??neburgplatz 1 > 60629 Frankfurt am Main, Germany -- Brian Salter-Duke (Brian Duke)
Re: urlview - open firefox tab
On 27Feb2009 09:07, Joseph wrote: > On 02/27/09 17:40, Cameron Simpson wrote: >> Ok, try this in your .urlview file: >> COMMAND exec >>urlview.out 2>&1; set -x; firefox -remote >> openURL\(%s,new-tab\) >> i.e. insert "exec >>urlview.out 2>&1; set -x;" into the front of your >> COMMAND string. >> >> Then use urlview from mutt and examine the urlview.out file afterwards. >> >> If we don't learn anything there we can write a small shell script. > > I tried as you suggested in urlview: > COMMAND exec >>urlview.out 2>&1; set -x; firefox -remote openURL\(%s,new-tab\) > > response: > Executing: exec >>urlview.out 2>&1; set -x; firefox -remote > openURL\('http://www.mutt.org/',new-tab\)... So, there was _nothing_ in the file "urlview.out"? That is strange. BTW, what is your shell? I'd expect urlview to use /bin/sh for its command but if it uses your login shell and your login shell is unusual there might be some trouble. -- Cameron Simpson DoD#743 http://www.cskk.ezoshosting.com/cs/ You can blip it twice to clear the bore, But blip it thrice, and you've sinned once more. - Tom Warner