PS1 or PROMPT refusing to change in zsh
Clash Royale CLAN TAG#URR8PPP
I enter in zsh:
% PS1=">>> "
But for some reason, the prompt is still the same:
% echo $PS1
%B%Fred%(?..%? )%f%b%B%Fblue%n%f%b@%m %B%40<..<%~%<< %b%#
Same thing with PROMPT.
It works well in bash and sh. How do I fix it?
zsh prompt
|
show 1 more comment
I enter in zsh:
% PS1=">>> "
But for some reason, the prompt is still the same:
% echo $PS1
%B%Fred%(?..%? )%f%b%B%Fblue%n%f%b@%m %B%40<..<%~%<< %b%#
Same thing with PROMPT.
It works well in bash and sh. How do I fix it?
zsh prompt
Do you have perhaps some pre- or post-command hook that's overwriting yourPS1
?
– DopeGhoti
Feb 4 at 19:40
I'm not sure what a hook is, I'm gonna check
– Cansico
Feb 4 at 19:41
Oh-my-zsh isnt installed, neither a zsh theme configuration
– Cansico
Feb 4 at 20:09
Runzsh -f
, and then try. It will invoke new shell without looking into any initialization files. If that works then it means some part of your startup file overwrites the prompt (preexec
andprecmd
functions are the most suspicious here).
– jimmij
Feb 4 at 22:58
Also interesting is that thePS1
shown does not produce a single%
as shown.
– JdeBP
Feb 4 at 23:18
|
show 1 more comment
I enter in zsh:
% PS1=">>> "
But for some reason, the prompt is still the same:
% echo $PS1
%B%Fred%(?..%? )%f%b%B%Fblue%n%f%b@%m %B%40<..<%~%<< %b%#
Same thing with PROMPT.
It works well in bash and sh. How do I fix it?
zsh prompt
I enter in zsh:
% PS1=">>> "
But for some reason, the prompt is still the same:
% echo $PS1
%B%Fred%(?..%? )%f%b%B%Fblue%n%f%b@%m %B%40<..<%~%<< %b%#
Same thing with PROMPT.
It works well in bash and sh. How do I fix it?
zsh prompt
zsh prompt
edited Feb 5 at 20:26
Kusalananda
132k17253416
132k17253416
asked Feb 4 at 19:38
CansicoCansico
314
314
Do you have perhaps some pre- or post-command hook that's overwriting yourPS1
?
– DopeGhoti
Feb 4 at 19:40
I'm not sure what a hook is, I'm gonna check
– Cansico
Feb 4 at 19:41
Oh-my-zsh isnt installed, neither a zsh theme configuration
– Cansico
Feb 4 at 20:09
Runzsh -f
, and then try. It will invoke new shell without looking into any initialization files. If that works then it means some part of your startup file overwrites the prompt (preexec
andprecmd
functions are the most suspicious here).
– jimmij
Feb 4 at 22:58
Also interesting is that thePS1
shown does not produce a single%
as shown.
– JdeBP
Feb 4 at 23:18
|
show 1 more comment
Do you have perhaps some pre- or post-command hook that's overwriting yourPS1
?
– DopeGhoti
Feb 4 at 19:40
I'm not sure what a hook is, I'm gonna check
– Cansico
Feb 4 at 19:41
Oh-my-zsh isnt installed, neither a zsh theme configuration
– Cansico
Feb 4 at 20:09
Runzsh -f
, and then try. It will invoke new shell without looking into any initialization files. If that works then it means some part of your startup file overwrites the prompt (preexec
andprecmd
functions are the most suspicious here).
– jimmij
Feb 4 at 22:58
Also interesting is that thePS1
shown does not produce a single%
as shown.
– JdeBP
Feb 4 at 23:18
Do you have perhaps some pre- or post-command hook that's overwriting your
PS1
?– DopeGhoti
Feb 4 at 19:40
Do you have perhaps some pre- or post-command hook that's overwriting your
PS1
?– DopeGhoti
Feb 4 at 19:40
I'm not sure what a hook is, I'm gonna check
– Cansico
Feb 4 at 19:41
I'm not sure what a hook is, I'm gonna check
– Cansico
Feb 4 at 19:41
Oh-my-zsh isnt installed, neither a zsh theme configuration
– Cansico
Feb 4 at 20:09
Oh-my-zsh isnt installed, neither a zsh theme configuration
– Cansico
Feb 4 at 20:09
Run
zsh -f
, and then try. It will invoke new shell without looking into any initialization files. If that works then it means some part of your startup file overwrites the prompt (preexec
and precmd
functions are the most suspicious here).– jimmij
Feb 4 at 22:58
Run
zsh -f
, and then try. It will invoke new shell without looking into any initialization files. If that works then it means some part of your startup file overwrites the prompt (preexec
and precmd
functions are the most suspicious here).– jimmij
Feb 4 at 22:58
Also interesting is that the
PS1
shown does not produce a single %
as shown.– JdeBP
Feb 4 at 23:18
Also interesting is that the
PS1
shown does not produce a single %
as shown.– JdeBP
Feb 4 at 23:18
|
show 1 more comment
1 Answer
1
active
oldest
votes
The precmd
function (which is run before displaying a new prompt) was resetting the prompt. All I had to do was:
precmd_functions=""
(this removes all precmd
"hook functions")
... and then I was able to change PS1
. It's possible to change it permanently by adding this line to ~/.zshrc
file.
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f498659%2fps1-or-prompt-refusing-to-change-in-zsh%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
The precmd
function (which is run before displaying a new prompt) was resetting the prompt. All I had to do was:
precmd_functions=""
(this removes all precmd
"hook functions")
... and then I was able to change PS1
. It's possible to change it permanently by adding this line to ~/.zshrc
file.
add a comment |
The precmd
function (which is run before displaying a new prompt) was resetting the prompt. All I had to do was:
precmd_functions=""
(this removes all precmd
"hook functions")
... and then I was able to change PS1
. It's possible to change it permanently by adding this line to ~/.zshrc
file.
add a comment |
The precmd
function (which is run before displaying a new prompt) was resetting the prompt. All I had to do was:
precmd_functions=""
(this removes all precmd
"hook functions")
... and then I was able to change PS1
. It's possible to change it permanently by adding this line to ~/.zshrc
file.
The precmd
function (which is run before displaying a new prompt) was resetting the prompt. All I had to do was:
precmd_functions=""
(this removes all precmd
"hook functions")
... and then I was able to change PS1
. It's possible to change it permanently by adding this line to ~/.zshrc
file.
edited Feb 5 at 20:22
Kusalananda
132k17253416
132k17253416
answered Feb 5 at 20:17
CansicoCansico
314
314
add a comment |
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f498659%2fps1-or-prompt-refusing-to-change-in-zsh%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Do you have perhaps some pre- or post-command hook that's overwriting your
PS1
?– DopeGhoti
Feb 4 at 19:40
I'm not sure what a hook is, I'm gonna check
– Cansico
Feb 4 at 19:41
Oh-my-zsh isnt installed, neither a zsh theme configuration
– Cansico
Feb 4 at 20:09
Run
zsh -f
, and then try. It will invoke new shell without looking into any initialization files. If that works then it means some part of your startup file overwrites the prompt (preexec
andprecmd
functions are the most suspicious here).– jimmij
Feb 4 at 22:58
Also interesting is that the
PS1
shown does not produce a single%
as shown.– JdeBP
Feb 4 at 23:18