Bash integration interacts badly with PROMPT_COMMAND that manipulates PS1 #5582
Replies: 4 comments
-
I can't reproduce this; after running |
Beta Was this translation helpful? Give feedback.
-
Thanks for looking into this. It reproduces reliably for me. Maybe it's related to something else in my environment, I might have to try to reproduce it with a cleaner setup. |
Beta Was this translation helpful? Give feedback.
-
I can reproduce a variation of this where the prompt changes back and forth whenever I press ACTIVE [test]$
[test]$
ACTIVE [test]$
[test]$
ACTIVE [test]$
[test]$
ACTIVE [test]$ I see that behavior with and without I can also reproduce this in kitty and wezterm, so the behavior doesn't appear to be Ghostty-specific. I therefore think the issue is probably with |
Beta Was this translation helpful? Give feedback.
-
EDIT: Ok, so closing the Ghostty window is not enough to reload the configuration. With shell integration disabled the original problem is difficult to reproduce bacause opening a new tab does not preserve the working directory. But my example code given above does seem to work then. Note that I changed the code in the original question to behave more consistently. Sorry about that. |
Beta Was this translation helpful? Give feedback.
-
We use a prompt command hook that automatically activates and deactivates Python virtualenvs when entering/leaving a directory that has an associated virtualenv. This, in turn, manipulates
$PS1
to show the virtualenv name in the prompt string. When Ghostty is started in a directory that has an associated virtualenv, Ghostty's$PS1
handling gets confused:This does not happen with other terminal emulators (e.g. GNOME Terminal). It can be reproduced as follows, without any use of Python or virtualenvs:
* Add the following to your
~/.bashrc` (edited to address #5582 (comment) ):ls
)Beta Was this translation helpful? Give feedback.
All reactions