Created
August 11, 2023 11:14
-
-
Save Stephen-Harold/a26f7bc24632f740953d5bdb591363be to your computer and use it in GitHub Desktop.
Edit your prompt (PS1) instantly without sourcing.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# on MacOS | |
function precmd() { | |
PS1=$( ~/.promptFile $? ); | |
} | |
# on Linux | |
function customPrompt() { | |
PS1=$( ~/.promptFile $? ); | |
} | |
PROMPT_COMMAND=customPrompt; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In the prompt file echo a string which will instantly become your PS1.