After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 309201 - gnome-terminal doesn't match nntp or file URLs.
gnome-terminal doesn't match nntp or file URLs.
Status: RESOLVED FIXED
Product: gnome-terminal
Classification: Core
Component: general
2.10.x
Other Linux
: Normal normal
: ---
Assigned To: GNOME Terminal Maintainers
GNOME Terminal Maintainers
Depends on:
Blocks:
 
 
Reported: 2005-06-30 11:09 UTC by Sebastien Bacher
Modified: 2006-01-27 00:36 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Sebastien Bacher 2005-06-30 11:09:19 UTC
This bug has been opened here: https://bugzilla.ubuntu.com/show_bug.cgi?id=12285

"gnome-terminal 2.10.0-0ubuntu doesn't match URLs with a scheme of `nntp'
or `file' making it tedious to open said links in a browser.  I think
this is because

    $ grep 'define SCHEME' gnome-terminal-2.10.0/src/terminal-screen.c
    #define SCHEME    "(news|telnet|nttp|file|https?|ftps?|webcal)"

`nttp' is probably meant to be `nntp' and `file' is omitted."
Comment 1 Kjartan Maraas 2005-06-30 13:37:56 UTC
I see file there right in the middle, is that not working somehow?
Comment 2 Kjartan Maraas 2005-06-30 13:39:28 UTC
Hmm, it seems this is beacuse a file:/// uri uses three slashes. It works if you
type file://some/path/to/a/file

Comment 3 Kjartan Maraas 2005-06-30 13:42:33 UTC
terminal
Comment 4 Sebastien Bacher 2005-06-30 13:55:01 UTC
right, same comment on the ubuntu bug:

"Oops.  You're right, `file' isn't missing from SCHEME's definition.  The
problem is the regular expression that uses SCHEME.

    #define USERCHARS "-A-Za-z0-9"
    #define PASSCHARS "-A-Za-z0-9,?;.:/!%$^*&~\"#'"
    #define HOSTCHARS "-A-Za-z0-9"
    #define SCHEME    "(news|telnet|nttp|file|https?|ftps?|webcal)"
    #define USER      "[" USERCHARS "]+(:["PASSCHARS "]+)?"

      terminal_widget_match_add (screen->priv->term,
          "\\<(" SCHEME "://(" USER "@)?)[" HOSTCHARS ".]+(:[0-9]+)?"
          "(/[-A-Za-z0-9_$.+!*(),;:@&=?/~#%]*[^]'.}>) \t\r\n,\\\"])?\\>",
          FLAVOR_AS_IS);

It insists on there being one or more of [HOSTCHARS.] after the first
two slashes so it fails to match `file:///etc/passwd'.  I don't know if
any other of the listed schemes can also have `///'."

Comment 5 Sebastien Bacher 2005-06-30 13:56:22 UTC
opening file://path doesn't use nautilus though, but that's probably an another bug
Comment 6 Kjartan Maraas 2005-07-01 23:33:22 UTC
Commited the nntp part.
Comment 7 Guilherme de Siqueira Pastore 2006-01-09 02:11:49 UTC
Fixed in CVS HEAD just now. Thanks.
Comment 8 Björn Torkelsson 2006-01-26 20:46:00 UTC
Using gnome-terminal 2.13.2 from Ubuntu Dapper I get the following warning when I start a gnome-terminal: 

* (gnome-terminal:5471): WARNING **: Error compiling regular expression "\<(file:///(/[-A-Za-z0-9_$.+!*(),;:@&=?/~#%]*[^]'.}>)

Checking terminal-screen.c I found the following: 

  terminal_widget_match_add (screen->priv->term,
                             "\\<file:///(" URLPATH ")?", FLAVOR_AS_IS);

Shouldn't it be: 

"\\<file:///(" URLPATH ")?\\>"

/torkel
Comment 9 Guilherme de Siqueira Pastore 2006-01-27 00:36:21 UTC
2.13.2 is old, it's fixed in CVS HEAD.