You are not logged in.

#1 2020-04-25 02:32:00

hexnether
Member
Registered: 2020-04-20
Posts: 9

[SOLVED] Method call on terminal startup

Hi all,

This is somewhat a continuation of a previous topic however I've made some progress on the issue and it's transformed into something a bit different so I thought I'd put it under a new topic.
My terminal runs

cat ~/.cache/wal/sequences

on startup which results in the terminal colors being changed. This command does not exist in my .bashrc, kitty (the terminal emulator I'm using) config, .xinitrc, i3 config, or any other startup script I can think of and I can't understand why it's being performed at the beginning of every terminal.

From reading the pywal code, I understand the command comes from sequences.py but since I commented out

wal -R

from my i3 config pywal surely shouldn't have any processes running once I reboot.

Thanks in advance,

Last edited by hexnether (2020-04-26 14:10:08)

Offline

#2 2020-04-25 06:31:31

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 73,342

Re: [SOLVED] Method call on terminal startup

I doubt it is, but let's see

urxvt -hold -e date
kitty --hold -e date

How do the colors behave when not running an interactive shell?

strace urxvt -hold -e date > /tmp/urxvt.strace 2>&1

Inspeact and upload that file (use ix.io or so, it's gonna be a shitload of text)

Also inspect/post "xrdb -q" (assuming wal writes that and this is where the VTE picks the colors up from on the next instance)

Afaiu in the other thread, you generally want the pywal colors but in some intances you don't.
It will be in those instances where you've to apply different colors, eg.

urxvt -foreground '#1793D0' -background '#272727'
urxvt -foreground '#1793D0' -background '#272727' -hold -e date # to rule out interference from your shell

Offline

#3 2020-04-25 20:30:22

hexnether
Member
Registered: 2020-04-20
Posts: 9

Re: [SOLVED] Method call on terminal startup

seth wrote:

I doubt it is, but let's see

urxvt -hold -e date
kitty --hold -e date

How do the colors behave when not running an interactive shell?

strace urxvt -hold -e date > /tmp/urxvt.strace 2>&1

Inspeact and upload that file (use ix.io or so, it's gonna be a shitload of text)

Also inspect/post "xrdb -q" (assuming wal writes that and this is where the VTE picks the colors up from on the next instance)

Afaiu in the other thread, you generally want the pywal colors but in some intances you don't.
It will be in those instances where you've to apply different colors, eg.

urxvt -foreground '#1793D0' -background '#272727'
urxvt -foreground '#1793D0' -background '#272727' -hold -e date # to rule out interference from your shell

On running

urxvt -hold -e date

a terminal with default colours (i.e. white and black) appears and runs date: strace.

kitty --hold -e date

creates a terminal with pywalled colours.

xrdb -q

returns nothing since I have not run "wal -R" this session (as I am trying to isolate the problem) so the X resources aren't being set, correct me if I'm wrong about this.

urxvt -foreground '#1793D0' -background '#272727'

creates a terminal with my pywalled colours (not the ones passed).

urxvt -foreground '#1793D0' -background '#272727' -hold -e date

creates a terminal with the correct custom colours.
Does this mean that the source of the call is my shell? I'm even more confused about the fact that urxvt colours seem to respond to -(-)hold but kitty's don't.

Edit:
I took the liberty of running strace on both "kitty" and "kitty --hold -e date", and found the lines

read(3, "include ~/.cache/wal/colors-kitt"..., 8192) = 370
openat(AT_FDCWD, "/home/hex/.cache/wal/colors-kitty.conf", 0_RDONLY|0_CL0EXEC) = 4

in both which don't appear in the urxvt strace. I tried to ix.io these files but they're too large (I'm assuming).
I hope this is in some way relevant.

Last edited by hexnether (2020-04-25 20:34:35)

Offline

#4 2020-04-25 20:42:14

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 73,342

Re: [SOLVED] Method call on terminal startup

Does this mean that the source of the call is my shell?

One source, yes.

pywal likely also writes the kitty config and this is where kitty gets its colors from.
If maintaining colors through the shell will suffice, you could "chattr +i ~/.config/kitty/kitty.conf" (this will set the file immutable ad you have to reverse this even if you want to edit it!) and kitty also supports reading from different config files, so you could eg. run "kitty -c ~/.config/kitty/mutt.conf" to run kitty with a config with mutt specific colors that also starts mutt etcetc.

Edit: you could try to upload the chunk around it, but the file is possibly references in kitty.conf

Last edited by seth (2020-04-25 20:43:35)

Offline

#5 2020-04-25 21:38:32

hexnether
Member
Registered: 2020-04-20
Posts: 9

Re: [SOLVED] Method call on terminal startup

seth wrote:

Does this mean that the source of the call is my shell?

One source, yes.

pywal likely also writes the kitty config and this is where kitty gets its colors from.
If maintaining colors through the shell will suffice, you could "chattr +i ~/.config/kitty/kitty.conf" (this will set the file immutable ad you have to reverse this even if you want to edit it!) and kitty also supports reading from different config files, so you could eg. run "kitty -c ~/.config/kitty/mutt.conf" to run kitty with a config with mutt specific colors that also starts mutt etcetc.

Edit: you could try to upload the chunk around it, but the file is possibly references in kitty.conf

On checking my kitty.conf, it does not seem to have been overwritten by pywal, and I haven't run pywal again since rebooting so surely there should be no pywal process to rewrite the config, which contains my higher contrast desired colours.
If the shell is the source, how can I prevent it sending the escape sequence, it isn't mentioned in .bashrc or .bash_profile so I can't understand what is calling it?

Offline

#6 2020-04-26 06:32:39

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 73,342

Re: [SOLVED] Method call on terminal startup

One of the global profiles/rcs/includes might contain that line.
Run "urxvt -e bash -x" to generate debug output.

Post your kitty.conf and more context for the

read(3, "include ~/.cache/wal/colors-kitt"..., 8192) = 370
openat(AT_FDCWD, "/home/hex/.cache/wal/colors-kitty.conf", 0_RDONLY|0_CL0EXEC) = 4

lines.

If you have a google account, you can upload the complete strace to your google drive (which is good from several GB - should suffice ;-)

Offline

#7 2020-04-26 14:06:26

hexnether
Member
Registered: 2020-04-20
Posts: 9

Re: [SOLVED] Method call on terminal startup

seth wrote:

One of the global profiles/rcs/includes might contain that line.
Run "urxvt -e bash -x" to generate debug output.

Post your kitty.conf and more context for the

read(3, "include ~/.cache/wal/colors-kitt"..., 8192) = 370
openat(AT_FDCWD, "/home/hex/.cache/wal/colors-kitty.conf", 0_RDONLY|0_CL0EXEC) = 4

lines.

If you have a google account, you can upload the complete strace to your google drive (which is good from several GB - should suffice ;-)

Thank you! I was honestly starting to think I would never solve this.
This was exactly it: there was a "cat ~/.cache/wal/sequences" line in my "/etc/bash.bashrc" which recoloured all terminals, I commented it out and everything's working fine now. I can include generated kitty-confs in my user-written kitty.conf and all overriding of colours works perfectly.

Offline

Board footer

Powered by FluxBB