• We did not send an email asking for donations - please read this post.

How does one make URLs in the terminal function as links?

CrazedNerd

Well-Known Member
Joined
Mar 31, 2021
Messages
784
Reaction score
307
Credits
6,701
I'm curious because every time you read a URL through text in the terminal, it acts like it will go to the link when you click on it (the underline appears when you put your cursor over it). However, when I click on them, they never go anywhere. Is there a way to set a browser for command line links? The default browser for the system tends to be mozilla, but i'm wondering why the links in terminal text are not actually links.

EDIT: You just have to right click and it will open mozilla...
 
Last edited:


dos2unix

Well-Known Member
Joined
May 3, 2019
Messages
1,561
Reaction score
1,181
Credits
9,934
Having them "be links" is one thing.

That is done through html.

www.google.com

is really... (I've over simplified it quite a bit )

Code:
<html>
<head><title>Google Page</title></head>
<body>
<a href=https://www.google.com>www.google.com</a><br />
</body>
</html>

Your browser hides all that from you and just renders the link for you.
There are console based browsers however ( links and lynx for example )
Some applications such as Microsoft word and LibeOffice writer will do the
html automatically for you in the background.
 
OP
CrazedNerd

CrazedNerd

Well-Known Member
Joined
Mar 31, 2021
Messages
784
Reaction score
307
Credits
6,701
Having them "be links" is one thing.

That is done through html.

www.google.com

is really... (I've over simplified it quite a bit )

Code:
<html>
<head><title>Google Page</title></head>
<body>
<a href=https://www.google.com>www.google.com</a><br />
</body>
</html>

Your browser hides all that from you and just renders the link for you.
There are console based browsers however ( links and lynx for example )
Some applications such as Microsoft word and LibeOffice writer will do the
html automatically for you in the background.
I guess the missing thing here is...is there a way to do your standard "left-click" (i kinda laughed to myself since it's reverse for me, to me the left click is a right click...) in the terminal to have it pop up in firefox? Terminal browsers to me seem kinda pointless albeit interesting, it seems like the colors and graphics are designed to help you find things easier. Is this just a system-programming thing that doesn't have an easy solution?
 

jpnilson

Active Member
Joined
Jul 31, 2021
Messages
123
Reaction score
67
Credits
1,087
I'm curious because every time you read a URL through text in the terminal, it acts like it will go to the link when you click on it (the underline appears when you put your cursor over it). However, when I click on them, they never go anywhere. Is there a way to set a browser for command line links? The default browser for the system tends to be mozilla, but i'm wondering why the links in terminal text are not actually links.

EDIT: You just have to right click and it will open mozilla...
well if I understand what you are saying the HTML to make all that work would not function in a terminal.
 

wizardfromoz

Administrator
Staff member
Gold Supporter
Joined
Apr 30, 2017
Messages
7,784
Reaction score
6,611
Credits
28,633
EDIT: You just have to right click and it will open mozilla...

Actually, being pedantic - if you have more than one browser on a distro, it will open in the default browser.

On most of my Distros, I have at least Firefox and Waterfox (and on some, more). I usually set Waterfox as the default, but my go to browser is often Firefox.

So if you right-click the link in Terminal it will open in the default, which may prove inconvenient if you already have an alternative browser open.

Cheers

Wizard
 
$100 Digital Ocean Credit
Get a free VM to test out Linux!

Linux.org Hosting Donations
Consider making a donation

Staff online

Members online


Top