bash-oo-framework
bash-oo-framework copied to clipboard
required packages
the framework works out of the box in my current ubuntu.
I have a docker container using debian9 and bash 4.4.12. I am getting output like this
igor@04e68d65320c:~/containerroot$ ./igorpro --registerfile serial.txt
activating bash-oo-framework
! Press [CTRL+C] to exit or [Return] to continue execution.
{*} Continuing...
! Press [CTRL+C] to exit or [Return] to continue execution.
where the error description and backtrace is missing. Do I need to install any required packages or fonts - I could not find anything.
Maybe this helps?
https://stackoverflow.com/questions/33493456/docker-bash-prompt-does-not-display-color-output
i do get colors using
$ python -c "print('\033[91mtest\033[0m')"
test
there is really no text underneath the overementioned message.
actually, @tterranigma the post had some right ideas. I added the following:
USER igor
# activate color terminal
ENV TERM xterm-256color
RUN sed -i -e 's/^#force_color_prompt=[^\n]*/force_color_prompt=yes/' ~/.bashrc
sourceing ./basrc at run-time after editing is not enough for bash-oo-framework. setting TERM in run-time user environment is also not enough.
Has there been no requirement yet for non-colored terminals? I would have expected pure text-output if no color is activated.
We do have color mode detection. No colors should be displayed when we detect a terminal without support for colors:
https://github.com/niieani/bash-oo-framework/blob/505d7eba2ab9d56a77f256222bb48d93d76ecfcb/lib/UI/Color.sh#L1
Perhaps that line doesn't work under Docker. Happy to accept PRs that fix this!
Thanks for investigating. Related issue #19
with ENV TERM xterm-256color
$ echo [ $(tput colors 2>/dev/null || echo 0) -ge 16 ]
[ 256 -ge 16 ]
without setting any ENV:
$ echo [ $(tput colors 2>/dev/null || echo 0) -ge 16 ]
[ 8 -ge 16 ]
I don't understand the second part but it resolves to true
$if test -t 1; then echo 1;fi
1
So it seems, standard docker containers get 8 colors. Is 16 colors really a minimum requirement here?