l3laze / sind Goto Github PK
View Code? Open in Web Editor NEWA simple, interactive, list-friendly dialog for Bash 4+.
License: The Unlicense
A simple, interactive, list-friendly dialog for Bash 4+.
License: The Unlicense
$ echo "$(./sind.sh -t Title -o Okay -c)"
Title (↑/j or ↓/|k, enter: choose)
------------------------------------------------------------------------------------------------------
Okay
System version
NAME="Ubuntu"
VERSION="18.04.4 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.4 LTS"
VERSION_ID="18.04"
There are also systems Mac OS 10.15.7 and CentOS 7 that don't work.
But the functions provided by Alexander Klimetschek work properly.
Vim user here, I like j/k for movement, so here's a patch.
38a39,40
> if [[ "$key" == 'k' ]]; then echo "up"; break; fi
> if [[ "$key" == 'j' ]]; then echo "down"; break; fi
Thanks for putting it on github.
Cheers
Is it possible to choose from column
output such as followings?
Choose version:
v1.0.9 v1.0.7 v1.0.5 v1.0.3 v1.0.2 v1.0.1
v1.0.8 v1.0.6 v1.0.4
I am unable to capture the selection running Ubuntu 20
The example code waits like this:
test@ubuntu:~$ echo "$(./sind.sh -o "thing1" "thing2" -c)"
Choose one (↑/j or ↓/|k, enter: choose)
--------------------------------------------------------------------------------
thing1
Pressing arrow keys a few times and then enter does reveal the menu and move on, but the output is not useful:
test@ubuntu:~$ echo "$(./sind.sh -o "thing1" "thing2" -c)"
Choose one (↑/j or ↓/|k, enter: choose)
--------------------------------------------------------------------------------
thing1
thing2
Cancel
--------------------------------------------------------------------------------
thing2Cancelthing1Cancelthing1thing2thing2Cancelthing1
test@ubuntu:~$
Running the program without trying to capture works correctly:
Choose one (↑/j or ↓/|k, enter: choose)
--------------------------------------------------------------------------------
thing1
thing2
Cancel
--------------------------------------------------------------------------------
thing2
test@ubuntu:~$
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.