Menu

changing terminal colors leads to makeboot.sh error

TF
2017-01-27
2018-07-15
  • TF

    TF - 2017-01-27

    I don't see an easy way to change the hardwired terminal colors used in the various shell scripts. They are ok on a black background terminal, but the yellow text in particular is nearly invisible on a white background terminal.

    I don't know if there's an easy way for you to detect the background color on a terminal so you could use a different color set if it was light, but that would help in general for all scripts.

    Meanwhile, I tried to look at the live utils/linux/makeboot.sh script to see if I could modify the colors outside the script. It appeared that it would accept different values for SETCOLOR_WARNING, for example.

    So I tried changing from the script's yellow (33) to blue (34) by setting a variable outside in the calling shell

    export SETCOLOR_WARNING="echo -en \\033[1;34m"
    

    before running makeboot.sh, but that lead to the bash error:

    makeboot.sh: line 36: [: too many arguments
    

    It appears to me that if you change the script from using the single bracket '[ ]' test mode to the double bracket test mode '[[ ]]' for the SETCOLOR_* variables that it would work.

    As an example I tried in a shell the syntax as makeboot.sh has it

    $ XV="echo -en \\033[1;32m"
    $ [ -z {$XV:-''} ] && XV="two"
    bash: [: too many arguments
    

    but changing to [[ ]] works:

    $ XV="echo -en \\033[1;32m"
    $ [[ -z ${XV:-''} ]] && XV="two"
    $ echo $XV
    echo -en \033[1;32m
    

    appears to work.

     
  • Steven Shiau

    Steven Shiau - 2017-01-31

    Thanks for reporting this. Yes, we should detect if the terminal supports color output. It will be implemented in the testing release.

    Steven

     
  • anonyxuser

    anonyxuser - 2018-06-06

    Is there any update to this? I am quite eager to change the  blue terminal background when selecting clonezilla options and when cloning is in progress to black. Thank you so much for your time and for the great software! :)

     

    Last edit: anonyxuser 2018-06-06
  • Steven Shiau

    Steven Shiau - 2018-07-15

    So you still have issue about this? We have used "tput colors" in makeboot.sh to detect the terminal. It should work. Which version of Clonezilla live did you use? Did you try Clonezilla live >= 2.5.5-38?
    https://clonezilla.org/downloads.php

    Steven

     

Log in to post a comment.