Score:1

"Custom command" seems to have no effect in gnome-terminal profile

ca flag

Per this answer I added a custom command in my gnome-terminal profile specifying an rc file as explained in that answer. Specifically, my custom command is /bin/bash --rcfile "/home/dqbydt/.gitplrc". However, it appears to have no effect (the contents of that rc enable powerline, so the prompt changes quite dramatically if the script has been executed). I can source that same rc file manually after the terminal opens, and that does work. So there isn't anything in the rc itself that is suspect.

I have set a new font for that profile and that does change, so the profile itself is indeed getting applied. However the custom command is definitely not getting executed. What can I try? This is on Ubuntu 20.04.

hr flag
Is the *"Run Command as a login shell"* boxed checked, by any chance?
dqbydt avatar
ca flag
No, sure isn't. The entirety of the configuration on the Command tab is as follows: _Run command as a login shell_ : unchecked _Run a custom command instead of my shell_ : checked _Custom command_ : set as above _Preserve working directory_ : set to Shell only _When command exits_ : Exit the terminal It shouldn't need logout/login to take effect, right?
cn flag
Use `ps` to check: is the newly launched program indeed not what you specified in the settings?
cn flag
You do launch a _new_ terminal with the given profile, do you? Because if you change profile after launching a terminal, the custom command obviously cannot be applied.
dqbydt avatar
ca flag
@egmont Indeed, yes, I am launching a new terminal and then changing the profile (the newly created profile is intentionally not default). I added an `echo` of `$(date)` to a file from the custom-command rc script and that does not get updated. But I can manually source `. /home/dqbydt/.gitplrc` in the new terminal after the profile switch, and that works. The file gets updated; the prompt changes as desired; everything is good.
cn flag
You should find the menu entry that launches a _new_ terminal with the profile of your choice. Once a terminal is launched with a certain profile, including a command belonging to that profile, there's no way the command there could be replaced. That part of the profile setting cannot be applied upon profile change.
dqbydt avatar
ca flag
Huh, yes, that works! This is a critical piece of information missing in the other answer as well. If you add this as an answer I am happy to accept it.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.