I recently stumbled across tmux while trying to provide a more customized UX in a bash script. Tmux and screen seemed a little more powerful than I needed, with lots of ways to accidentally corrupt the terminal. More and less were pretty close to what I wanted, but I could not figure out how to accept arbitrary input from the less prompt, exit, and pass it to bash.
Maybe that's not what less is for. Any tips on how I can create a less UX with custom input handling would be appreciated.
For future reference, if you want to replicate a git-like man page UX (using less as the pager) the trick is defining custom commands with lesskey[0]. You can specify the exit status of the "quit" action to pass the information back to the calling script.
Maybe that's not what less is for. Any tips on how I can create a less UX with custom input handling would be appreciated.