Re: ctrl-click on urls in terminal



In message <20000107102208.B987@venables-0060.salford.ac.uk>, d.rose@salford.ac
.uk writes:

>The URL found in the attached message doesn't get passed to my
>web broweser on a ctrl-click as I expect. It manages to pass
>everything up to the '%20', including the '%' but after that
>none of the URL shows up in the web browser.

>Bug or config problem?

Lines 2101-2104 of gnome-core-1.0.55/gnome-terminal/gnome-terminal.c contain
the following nastiness:

#ifdef ZVT_TERM_MATCH_SUPPORT
	zvt_term_match_add( ZVT_TERM(term), "(((news|telnet|nttp|file|http|ftp)://)|(www|ftp))[-A-Za-z0-9\\.]+(:[0-9]*)?", VTATTR_UNDERLINE, "host only url");
	zvt_term_match_add( ZVT_TERM(term), "(((news|telnet|nttp|file|http|ftp)://)|(www|ftp))[-A-Za-z0-9\\.]+(:[0-9]*)?/[-A-Za-z0-9_\\$\\.\\+\\!\\*\\(\\),;:@&=\\?/~\\#]*[^]'\\.}>\\) ,\\\"]", VTATTR_UNDERLINE, "full url");
#endif

The latter regular expression is particularly nasty and should be explained in
words in a comment.  Even a regular expression expert will be left scratching
his head since the zvt regexp parser seems to require certain additional escape
characters.  The situation wouldn't be so bad if the two regular expressions
actually matched all URL's, but they do not.

John

--
John GOTTS <jgotts@linuxsavvy.com>  http://www.linuxsavvy.com/staff/jgotts



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]