timo-reymann / bash-tui-toolkit

Toolkit to create simple Terminal UIs using plain bash builtins
Apache License 2.0
41 stars 3 forks source link

Support piped scripts #31

Closed ThaDaVos closed 2 weeks ago

ThaDaVos commented 3 weeks ago

Description

Currently when a script is piped to bash, the read calls will see this script as input - one way to fix this is appending </dev/tty to the calls and getting it to work again - I was curious if the library could support this itself, so one does not have to append </dev/tty to each command

References

No response

ThaDaVos commented 3 weeks ago

Or at least add a note about it in the docs that it's needed (maybe I've read over it though)

timo-reymann commented 3 weeks ago

Hey, sounds like a good idea to me :)

For Mac and Linux, that should work just fine. Not 100% sure about Windows, though, so I will have to verify this first. Maybe (as usual) Windows requires special treatment here :)

ThaDaVos commented 3 weeks ago

Yeah Windows always needs special treatment in this cases - but luckily Powershell7 is coming a long way - still didn't know this toolkit worked on Windows - I am using it inside WSL2 though without issues

timo-reymann commented 3 weeks ago

Tested with Git Bash running bash 4.4.23, /dev/tty & read works like a charm. WSL should be fine as it's basically Ubuntu.

timo-reymann commented 2 weeks ago

:tada: This issue has been resolved in version 1.7.0 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: