How some applications accept mouse click in bash over ssh?
Clash Royale CLAN TAG#URR8PPP
up vote
4
down vote
favorite
Applications like lynx
browser, htop
etc and many others accept position dependent mouse clicks in bash
over ssh
shell. I know that ssh
is a command line interface. Then how does it accepts mouse clicks?
linux bash ssh command-line mouse
add a comment |Â
up vote
4
down vote
favorite
Applications like lynx
browser, htop
etc and many others accept position dependent mouse clicks in bash
over ssh
shell. I know that ssh
is a command line interface. Then how does it accepts mouse clicks?
linux bash ssh command-line mouse
add a comment |Â
up vote
4
down vote
favorite
up vote
4
down vote
favorite
Applications like lynx
browser, htop
etc and many others accept position dependent mouse clicks in bash
over ssh
shell. I know that ssh
is a command line interface. Then how does it accepts mouse clicks?
linux bash ssh command-line mouse
Applications like lynx
browser, htop
etc and many others accept position dependent mouse clicks in bash
over ssh
shell. I know that ssh
is a command line interface. Then how does it accepts mouse clicks?
linux bash ssh command-line mouse
edited Jan 22 at 21:36
Jeff Schaller
31.7k847108
31.7k847108
asked Jan 22 at 16:44
Abhik Bose
1,5341217
1,5341217
add a comment |Â
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
5
down vote
accepted
IMHO, the simplest way to write such a TUI application is to use ncurses.
"New Curses" is a library that abstracts the design of the TUI from the details of the underlying device. All the software you cited use ncurses to render their interface.
When you click on a terminal emulator (e.g. xterm, gnome-term, etc), the terminal emulator translates the click in a sequence of ANSI Escape codes. These sequences are read and translated in events by the ncurses library.
You can find an example on Stack Overflow: Mouse movement events in NCurses
Great answer in a very interesting (at least for me) question!
â k.Cyborg
Jan 22 at 18:34
add a comment |Â
up vote
3
down vote
It's pretty simple, in a old school serial terminal session, the mouse was not really an option for sending input to the interactive shell session. (I am sure there were some early exceptions.)
However when you are running a terminal emulator inside a graphical desktop session the terminal emulator can be mouse aware.
What happens on a high level is that the mouse events are translated by the terminal emulator (xterm
for example) into terminal sequences and those are sent to the interactive shell session the application you are running, htop
, vim
whatever. In this case vim
just sees the terminal sequence (like a simple series of keyboard events would produce), not the mouse event.
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
5
down vote
accepted
IMHO, the simplest way to write such a TUI application is to use ncurses.
"New Curses" is a library that abstracts the design of the TUI from the details of the underlying device. All the software you cited use ncurses to render their interface.
When you click on a terminal emulator (e.g. xterm, gnome-term, etc), the terminal emulator translates the click in a sequence of ANSI Escape codes. These sequences are read and translated in events by the ncurses library.
You can find an example on Stack Overflow: Mouse movement events in NCurses
Great answer in a very interesting (at least for me) question!
â k.Cyborg
Jan 22 at 18:34
add a comment |Â
up vote
5
down vote
accepted
IMHO, the simplest way to write such a TUI application is to use ncurses.
"New Curses" is a library that abstracts the design of the TUI from the details of the underlying device. All the software you cited use ncurses to render their interface.
When you click on a terminal emulator (e.g. xterm, gnome-term, etc), the terminal emulator translates the click in a sequence of ANSI Escape codes. These sequences are read and translated in events by the ncurses library.
You can find an example on Stack Overflow: Mouse movement events in NCurses
Great answer in a very interesting (at least for me) question!
â k.Cyborg
Jan 22 at 18:34
add a comment |Â
up vote
5
down vote
accepted
up vote
5
down vote
accepted
IMHO, the simplest way to write such a TUI application is to use ncurses.
"New Curses" is a library that abstracts the design of the TUI from the details of the underlying device. All the software you cited use ncurses to render their interface.
When you click on a terminal emulator (e.g. xterm, gnome-term, etc), the terminal emulator translates the click in a sequence of ANSI Escape codes. These sequences are read and translated in events by the ncurses library.
You can find an example on Stack Overflow: Mouse movement events in NCurses
IMHO, the simplest way to write such a TUI application is to use ncurses.
"New Curses" is a library that abstracts the design of the TUI from the details of the underlying device. All the software you cited use ncurses to render their interface.
When you click on a terminal emulator (e.g. xterm, gnome-term, etc), the terminal emulator translates the click in a sequence of ANSI Escape codes. These sequences are read and translated in events by the ncurses library.
You can find an example on Stack Overflow: Mouse movement events in NCurses
answered Jan 22 at 17:13
andcoz
11.7k32938
11.7k32938
Great answer in a very interesting (at least for me) question!
â k.Cyborg
Jan 22 at 18:34
add a comment |Â
Great answer in a very interesting (at least for me) question!
â k.Cyborg
Jan 22 at 18:34
Great answer in a very interesting (at least for me) question!
â k.Cyborg
Jan 22 at 18:34
Great answer in a very interesting (at least for me) question!
â k.Cyborg
Jan 22 at 18:34
add a comment |Â
up vote
3
down vote
It's pretty simple, in a old school serial terminal session, the mouse was not really an option for sending input to the interactive shell session. (I am sure there were some early exceptions.)
However when you are running a terminal emulator inside a graphical desktop session the terminal emulator can be mouse aware.
What happens on a high level is that the mouse events are translated by the terminal emulator (xterm
for example) into terminal sequences and those are sent to the interactive shell session the application you are running, htop
, vim
whatever. In this case vim
just sees the terminal sequence (like a simple series of keyboard events would produce), not the mouse event.
add a comment |Â
up vote
3
down vote
It's pretty simple, in a old school serial terminal session, the mouse was not really an option for sending input to the interactive shell session. (I am sure there were some early exceptions.)
However when you are running a terminal emulator inside a graphical desktop session the terminal emulator can be mouse aware.
What happens on a high level is that the mouse events are translated by the terminal emulator (xterm
for example) into terminal sequences and those are sent to the interactive shell session the application you are running, htop
, vim
whatever. In this case vim
just sees the terminal sequence (like a simple series of keyboard events would produce), not the mouse event.
add a comment |Â
up vote
3
down vote
up vote
3
down vote
It's pretty simple, in a old school serial terminal session, the mouse was not really an option for sending input to the interactive shell session. (I am sure there were some early exceptions.)
However when you are running a terminal emulator inside a graphical desktop session the terminal emulator can be mouse aware.
What happens on a high level is that the mouse events are translated by the terminal emulator (xterm
for example) into terminal sequences and those are sent to the interactive shell session the application you are running, htop
, vim
whatever. In this case vim
just sees the terminal sequence (like a simple series of keyboard events would produce), not the mouse event.
It's pretty simple, in a old school serial terminal session, the mouse was not really an option for sending input to the interactive shell session. (I am sure there were some early exceptions.)
However when you are running a terminal emulator inside a graphical desktop session the terminal emulator can be mouse aware.
What happens on a high level is that the mouse events are translated by the terminal emulator (xterm
for example) into terminal sequences and those are sent to the interactive shell session the application you are running, htop
, vim
whatever. In this case vim
just sees the terminal sequence (like a simple series of keyboard events would produce), not the mouse event.
answered Jan 22 at 17:00
datUser
2,2811032
2,2811032
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f418901%2fhow-some-applications-accept-mouse-click-in-bash-over-ssh%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password