Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I would like to be able to (double) click a file from the ls output and open it with the associated program. Anyone knows a way to do this?

Mouse-console interaction is possible with GPM and links shows how it works.

share|improve this question

2 Answers 2

The only think I could think of is if you write some sort of program using GPM and a simple programming language that can implement GPM. Then if you use this, you could replace the ls file in your binary folder (probably either /bin or /usr/bin) with this program (in compiled form).

share|improve this answer

This is up to your terminal to handle.

urxvt has a plugin interface that enables this kind of interaction. One of the standard plugins provides clickable URLs directly in the terminal. These plugins are Perl scripts, and it would surely be in the scope to do something close to what you want.

Easy would be to let fully specified paths open with the WM default application.

Harder would be to let relative links understand their directory context (perhaps reading $PWD), but it would also be possible.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.