dylanaraps / pywal

🎨 Generate and change color-schemes on the fly.
MIT License
8.26k stars 318 forks source link

cat sequences causes ]708;[100]#040805 to appear in new termite terminal #329

Closed pucerpocok closed 5 years ago

pucerpocok commented 5 years ago

$ wal -v wal 3.2.1

For me it seems that commit https://github.com/dylanaraps/pywal/commit/da0e2ff05a885422dfc61fc87ae3c68ec713751b introduced the issue. In my opinion set_color should be used instead of set_special (at least for me that resolved it). (Also adding 4; before 708; in .cache/wal/sequences solves the issue temporarily)

During the debugging of this I found another minor coding issue: in set_special() the default value for alpha is 100 (the number), while later in the function the alpha is compared to the string "100"(in python the number and string 100 are different), thus even if the alpha parameter is omitted and the value of it is 100 it will be added to the sequence. (Again, this is nothing serious, just wanted to leave a note about it)

Vichoko commented 5 years ago

The same formatted string appears to me in all opened gnome-terminal and guake instances when i execute wal -R. I have the same wal version.

The string printed in my case is: ]708;[100]#0a0c16\%

schlerp commented 5 years ago

same issue with me and termite, I set the 708 line in sequences.py to use set_color rather than set_special and everything appears to be working perfectly. I didn't read the code to fully understand what was going on, however i have tested a few applications now inside of termite and the colours are rendering properly.

could a dev please explain the difference between those methods and if its a possible solution?

aasril commented 5 years ago

The same formatted string appears to me in all opened gnome-terminal and guake instances when i execute wal -R. I have the same wal version.

The string printed in my case is: �]708;[100]#0a0c16�\%

executing cat ~/.cache/wal/sequences results on this line on gnome-terminal but not on urxvt and st.

I'm on Ubuntu 16.04. wal 3.2.1 (installed with pip)

adamson-dev commented 5 years ago

Also receiving this issue, have attached a screenshot for reference.

(cat ~/.cache/wal/sequences &) and cat ~/.cache/wal/sequences both cause this issue

pywal terminal garbage output

impankratov commented 5 years ago

executing cat ~/.cache/wal/sequences results on this line on gnome-terminal but not on urxvt and st.

Can confirm same behavior on arch. This line also appear in termite (probably since it's based on vte, just like gnome-terminal?).

zver43 commented 5 years ago

confirm on ArcoLinux v18-10-4 / and new 18-11-2 beta, run i3wm -gaps-next , Variety for wallpaper + pywal for fun :) this happens usually if more than 1 'termite' terminal is is open - if it is idle *display neofetch or run some app - does not make much sense , - noticed that xfce4-terminal and urxvt stay clean
arcolinux-2018-11-07-1541597001_screenshot_1920x1080 arcolinux-2018-11-07-1541597606_screenshot_1920x1080 arcolinux-2018-11-07-1541583618_screenshot_1920x1080

ghost commented 5 years ago

As mentioned from others, have same issue on Arch when opening terminal utilizing pywal. String is �]708;[100]#0a0c16�\%

Edit: Issue appears to be resolved after Termite update

aasril commented 5 years ago

@Makersmarx what do you update so the issue resolved itself?

ghost commented 5 years ago

Sorry @aasril I should have specified. Termite had an update and that seemed to have resolved the issue for me.

aasril commented 5 years ago

@Makersmarx thanks for clarifying that. I don't think gnome-terminal will have an update on Ubuntu soon. But in the meantime the solution @pucerpocok mentioned seems to work without side effects that I can tell.

Daniel-Vaz commented 5 years ago

I am having the same problem. The fix that @pucerpocok suggested doesn't work for me. I still get the line "]708;[100]#100a18\" every time I source my .bashrc. Any ideas ?

edit: Using fedora 28 Mate.

Vichoko commented 5 years ago

The solution i found is to downgrade pywal's version with pip. Something like this: $ pip install pywall==3.0.0

It worked for me.

Pd: i cant remember which version exactly i downgraded too, but any version before 3.2.1 will work.

impankratov commented 5 years ago

Sorry @aasril I should have specified. Termite had an update and that seemed to have resolved the issue for me.

Indeed, tried python-pywal 3.2.1 with termite 14.2 - got no extra output, everything is clean.

aasril commented 5 years ago

@Daniel-Vaz You need to rerun wal after making the change. By the way, I changed the 57th line into this. set_color(708, colors["special"]["background"]),

Daniel-Vaz commented 5 years ago

@Daniel-Vaz You need to rerun wal after making the change. By the way, I changed the 57th line into this. set_color(708, colors["special"]["background"]),

Ty worked for me.

GijsVermarien commented 5 years ago

Problem was there for me too, indeed rolling back to version 3.0.0 solved the problem for me too.

dylanaraps commented 5 years ago

Fixed in master. Use --vte with pywal. New release shortly.

nomad-mystic commented 5 years ago

On Ubuntu 18.04 (GNOME-terminal) getting this when running wal command. ]708;#06121F\%

pywal version 3.3.0

As mentioned by Daniel-Vaz to modify my sequence.py file for the special characters to not show up on command run.

sequence.py before:

def create_sequences(colors, vte_fix=False):
    """Create the escape sequences."""
    alpha = colors["alpha"]

    # Colors 0-15.
    sequences = [set_color(index, colors["colors"]["color%s" % index])
                 for index in range(16)]

    # Special colors.
    # Source: https://goo.gl/KcoQgP
    # 10 = foreground, 11 = background, 12 = cursor foregound
    # 13 = mouse foreground, 708 = background border color.
    sequences.extend([
        set_special(10, colors["special"]["foreground"], "g"),
        set_special(11, colors["special"]["background"], "h", alpha),
        set_special(12, colors["special"]["cursor"], "l"),
        set_special(13, colors["special"]["foreground"], "l"),
        set_special(17, colors["special"]["foreground"], "l"),
        set_special(19, colors["special"]["background"], "l"),
        set_color(232, colors["special"]["background"]),
        set_color(256, colors["special"]["foreground"])
    ])

    if not vte_fix:
        sequences.extend(
            set_special(708, colors["special"]["background"], "l", alpha)
        )

    if OS == "Darwin":
        sequences += set_iterm_tab_color(colors["special"]["background"])

    return "".join(sequences)

sequence.py after:

def create_sequences(colors, vte_fix=False):
    """Create the escape sequences."""
    alpha = colors["alpha"]

    # Colors 0-15.
    sequences = [set_color(index, colors["colors"]["color%s" % index])
                 for index in range(16)]

    # Special colors.
    # Source: https://goo.gl/KcoQgP
    # 10 = foreground, 11 = background, 12 = cursor foregound
    # 13 = mouse foreground, 708 = background border color.
    sequences.extend([
        set_special(10, colors["special"]["foreground"], "g"),
        set_special(11, colors["special"]["background"], "h", alpha),
        set_special(12, colors["special"]["cursor"], "l"),
        set_special(13, colors["special"]["foreground"], "l"),
        set_special(17, colors["special"]["foreground"], "l"),
        set_special(19, colors["special"]["background"], "l"),
        set_color(708, colors["special"]["background"]),
        set_color(232, colors["special"]["background"]),
        set_color(256, colors["special"]["foreground"])
    ])

    if OS == "Darwin":
        sequences += set_iterm_tab_color(colors["special"]["background"])

    return "".join(sequences)
aasril commented 5 years ago

@nomad-mystic Adding --vte option not fixing it for you? It works for me.