-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ENH] - Cleanup terminal prompt #1157
Comments
This is a point I reported a few months ago when I collected the users' feedbacks.
Example inspired from my own zsh :
|
I like @pierrotsmnrd suggestion for what the prompt should show. Does #1143 fix that? |
@dharhas currently #1143 fixes the issue with "/opt/conda/condabin..." being printed. Do we have a PS1 prompt that should be used @pierrotsmnrd? It needs to be bash compatible. All I would need to do then is add the PS1 to the file and it should be available. |
Hi @costrouc @dharhas, I was not able to generate a working example totally similar to what @pierrotsmnrd proposed, but I made this one The above PS1: PS1='\[\e[0m\][\[\e[0m\]$(git branch 2>/dev/null | grep '"'"'^*'"'"' | colrm 1 2)\[\e[0m\]] \[\e[0m\]\u\[\e[0m\]:\[\e[0m\]\w\n \[\e[0m\]> \[\e[0m\]\$ \[\e[0m\]'
source /usr/lib/git-core/git-sh-prompt
PS1='$(__git_ps1 "[%s]") \u\[\e[0m\]:\[\e[0m\]\w\n \[\e[0m\]> \[\e[0m\]\$ \[\e[0m\]' Adding conda env by looking at source /usr/lib/git-core/git-sh-prompt
export PS1=' $(__git_ps1 "[%s] ")\u\[\e[0m\]:\[\e[0m\]\w \n $(echo $CONDA_PROMPT_MODIFIER) \[\e[0m\]> \[\e[0m\]\$ \[\e[0m\]' |
Hi everyone I wasn't able to find a ready-to-use PS1, my prompt uses the I hope this helps. |
@costrouc @viniciusdc is this actually fixed? As far as I can tell, the issue was closed without the prompt actually being fixed OR there is no active deployment with the fix in place. qhub-beta still shows the old ugly bash prompt.
|
Hi, @dharhas the prompt configuration is currently set in here, if I know what we would like to see I can make the necessary changes. The clean up of the terminal logs, should have been fixed with a certain PR, c.c @costrouc here |
@viniciusdc your proposal from 3 comments above is good enough for now. Please do a PR for that. We can tweak again later. |
@viniciusdc A clean way to get a nice prompt is to use https://github.com/magicmonty/bash-git-prompt We would need to vendor the script and the folder
Then add the following to .bashrc
We can add the conda env by setting the changeps1 flag in conda (this can also be set in the condarc file)
This is more changes that I'm comfortable making since I'm not sure the best way to vendor code. |
two other things to change in the .bashrc
|
Feature description
When opening a terminal in JupyterLab the prompt could do with some cleanup.
dharhas@quansight.com@jupyter-dharhas-40quansight-2ecom:~$
Does
jupyter-dharhas-40quansight-2ecom
have any significance. If not we should just usedharhas@quansight.com:~$
as the promptAlso, why is
/opt/conda/condabin/conda
be printed twiceWe should also consider other things for a nice terminal prompt, i.e. git-prompt integration
Value and/or benefit
A clean prompt greatly enhances the usability of the terminal.
Anything else?
No response
The text was updated successfully, but these errors were encountered: