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

C

CrazedNerd

Guest
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 by a moderator:


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.
 
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?
 
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.
 
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
 


Top