Code Monkey home page Code Monkey logo

Comments (9)

gitbls avatar gitbls commented on September 7, 2024 1

OK. --batch should preclude the color from changing at all. I've modified the code in sdm to honor --batch so it won't change at all.

This will be in the next update to sdm later this week.

from sdm.

gitbls avatar gitbls commented on September 7, 2024

Thanks for trying sdm. Sorry to hear that you're having an issue.

Unfortunately, the problem you are seeing with konsole appears to be due to a deficiency in the konsole terminal emulator. From my testing, konsole returns the correct FG and BG colors, but does not return the cursor color. Further, when sdm presents the appropriate colors to konsole for restoring, they are not honored by konsole.

This code works correctly when using the xterm terminal emulator and others, which properly and completely honor the color escape sequences.

To avoid this unpleasant mis-colorization sdm will be updated to enable the console colorizing to be disabled using a specific setting (--mcolors 0 for mount and --ecolors 0 for explore and customize). In this case sdm will not modify the terminal colors and they will remain at whatever they are prior to running sdm.

Addenda: Curiously, the following bash function (which you can add to your .bashrc if desired) does work on konsole. But this is the same code that sdm uses, and I've verified that sdm is doing the right thing. I don't understand why it works with this function and not in sdm, but the above workaround will be implemented in lieu of spending time chasing down the root cause, which is likely to be some konsole oddity.

function xtset() {
    #
    # set xterm color. can specify 3 sets of pairs (e.g., fg yellow bg black cursor red)
    # $1=fg|bg|cursor
    # $2=color to set
    # if 'xtset reset' is used, the terminal colors are reset to white bg and black fg
    # Colors are listed in /etc/X11/rgb.txt (or /usr/share/X11/rgb.txt)
    #
    function xtsetx() {
        case "$1" in
            fg) printf "\e]10;${2}\a"
                ;;
            bg) printf "\e]11;${2}\a"
                ;;
            cur*) printf "\e]12;${2}\a"
                  ;;
            *) echo "Usage: xtset fg|bg|cur*sor color..."
               ;;
        esac
    }
    [ "$1" == "reset" ] && xtsetx fg black && xtsetx bg white && return
    [ "$1" != "" ] && xtsetx "$1" "$2"
    [ "$3" != "" ] && xtsetx "$3" "$4"
    [ "$5" != "" ] && xtsetx "$5" "$6"
} ; declare -fx xtset

from sdm.

ykharuzhy avatar ykharuzhy commented on September 7, 2024

Thanks. A switch to disable colorizing completely would be a good solution. Personally I use the sdm in an image building script for CI, so colors have no sense there.

from sdm.

gitbls avatar gitbls commented on September 7, 2024

Thanks. A switch to disable colorizing completely would be a good solution. Personally I use the sdm in an image building script for CI, so colors have no sense there.

Are you using the --batch switch on your customize command? sdm won't colorize the terminal and operates non-interactively to completion.

from sdm.

ykharuzhy avatar ykharuzhy commented on September 7, 2024

Yes, i use --batch but sdm uses colors anyway.

from sdm.

gitbls avatar gitbls commented on September 7, 2024

Could you provide the (appropriately redacted) command string that you are using? It shouldn't be coloring with --batch.

What I see at the end of your screen output is:

  * Enter shell command prompt
    'exit' to back to host system

which will not appear if you use --batch:

* Customization complete
* Batch Mode exit
umount: /mnt/sdm/boot/firmware unmounted

Thx

from sdm.

ykharuzhy avatar ykharuzhy commented on September 7, 2024

Yes, I added --batch later. I rechecked with unmodified sdm (I disabled color changing in the code before) — you are right, with --batch background color is changed to blue during of phase 1 but restored successfully.

from sdm.

gitbls avatar gitbls commented on September 7, 2024

--ecolors 0 and --mcolors 0 added in V12.3. Please test/verify. Thx

from sdm.

gitbls avatar gitbls commented on September 7, 2024

No activity so closing issue.

from sdm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.