tinmarino / mouse_xterm Goto Github PK
View Code? Open in Web Editor NEWMouse support to move (readline) cursor on xterm (Bash script)
Mouse support to move (readline) cursor on xterm (Bash script)
In /test
Automatically runned by .travis (on different terminal emulator / OS)
xterm
gnome-terminal
alacritty
kde-terminal
See in code why it happens and find a trick (like double buffering or cheaty redirection) to prevent user command line to disapear and appear again (alias flinkering)
Hi! Thank you for this awesome solution and for sharing it! Isn't it weird that so important and old tool like linux terminal stays so inconvenient in 2021? Its history stems from teletypes as physical devices, which didn't have cursor, obviously, but it is not an excuse imho.
Anyway, thanks for your efforts. The code works well if sourcing mouse.sh within an already running session, but when I saved the lines in .bashrc
and rebooted, I got a creepy message:
It doesn't seem to affect anything, but that's not something one would wish to see at startup...
Another issue: the terminal cursor lands 18 characters to the right of the mouse cursor.
On the screenshot the latter is not visible, but it is located exactly after ~$
Thanks so much for your script. I would love to get it to work as I would like to be able to click to move the cursor in Gnome Terminal running bash (ie. the default terminal and shell on Linux Mint).
I tried to use your script following the README.md ie. I did:
eval "$(curl -X GET https://raw.githubusercontent.com/tinmarino/mouse_xterm/master/mouse.sh)" && mouse_track_start
However, I got the error:
__bp_interactive_modemouse_track_echo_enable: command not found
I also get that error when I do:
printf '\e[?1000;1006;1015h'
About for my terminal says:
GNOME Terminal
3.36.2
A terminal emulator for the GNOME desktop
Using VTE version 0.60.3 +BIDI +GNUTLS +ICU +SYSTEMD
Bash version is:
GNU bash, version 5.0.17(1)-release-(x86_64-pc-linux-gnu)
$ mouse_track_start
bash: 1mouse_track_echo_enable: ambiguous redirect
Probably worth to look at: Term Mouse: A mouse reporting interface
On Ubuntu 18.04 I get the following error within a Terminator terminal:
bash: y0=<0 : y0=<0 : syntax error: operand expected (error token is "<0 ")
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.