Skip to content

Conversation

@Crivella
Copy link
Contributor

PROMPT_COMMAND is in general used with functions like _direnv_hook or posh-git (EG PROMPT_COMMAND="_direnv_hook;posh-git") that are unset in the environment of cmd.sh causing warning like

bash: _direnv_hook: command not found
bash: posh-git: command not found

at every command ran in a cmd.sh environment.

PROMPT_COMMAND is in general used for cosmetic / helper functions.
If there are usecases that do not rely on functions and do more than cosmetic we should also consider of it interfering with the cmd.sh environment.

Example of cmd.sh before and after unsetting PROMPT_COMMAND

crivella@crivella-desktop:~$ /tmp/eb-1bk1n87b/run-shell-cmd-output/export-fflfr7wr/cmd.sh
# Shell for the command: 'export OMPI_MCA_rmaps_base_oversubscribe=true &&  make test'
# Use command history, exit to stop
bash: _direnv_hook: command not found
bash: posh-git: command not found
eb-shell> 
bash: _direnv_hook: command not found
bash: posh-git: command not found
eb-shell> 
bash: _direnv_hook: command not found
bash: posh-git: command not found
eb-shell> unset PROMPT_COMMAND
eb-shell> 
eb-shell> 

Copy link
Member

@ocaisa ocaisa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ocaisa ocaisa merged commit 41fe3a4 into easybuilders:develop Oct 29, 2025
39 checks passed
@ocaisa
Copy link
Member

ocaisa commented Oct 29, 2025

Going in, thanks @Crivella

@Crivella Crivella deleted the feature-unset-promptcommand branch October 29, 2025 10:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants