Eu encontrei respostas Mas eles não funcionam: Eu adicionei esta linha em .bash_profile :
export PS1='u@H:w$' Solicita:
u@H:w$ em vez de:
user@host:my/Current/Path/In/This/Terminal/Window$
Eu encontrei respostas Mas eles não funcionam: Eu adicionei esta linha em .bash_profile :
export PS1='u@H:w$' Solicita:
u@H:w$ em vez de:
user@host:my/Current/Path/In/This/Terminal/Window$
I found answers but they don't work: I added this line in .bash_profile
:
export PS1='\u@\H:\w$'
It outputs:
\u@\H:\w$
Instead of:
user@host:my/Current/Path/In/This/Terminal/Window$
Como acabei de remover oh my zsh eu tive que alterar as configurações do terminal um pouco:
Terminal -> Preferences -> Startup tab e alterar "Shell abre com:" De "Shell de login padrão" para comando e valor
/bin/bash .
agora string export PS1='u@H:w$' funciona correto.
As I just removed oh my zsh
I had to change terminal settings a little:
Terminal -> Preferences -> Startup tab
, and change "Shell Opens With:" from "Default login shell" to Command and value /bin/bash
.
Now string export PS1='\u@\H:\w$'
works correct.
Com MacOS Catalina, a concha padrão é ZSH. Você pode mudar para o / bin / bash shell como explicado na resposta de Maxim. Ou ficar com o ZSH Shell e alterar o comando Run Startup para dizer
PROMPT='%/ %# ' O% / é para o caminho completo e% # para indicar se o shell está funcionando com privilégios. Mais explicações e a lista completa de personalizações é Aqui .
Achei esta informação aqui < / a>.
Você pode adicionar o comando de execução de inicialização mencionado acima no campo 'Executar comando:' no Terminal & GT; Preferências & GT; Perfis & gt; Shell & GT; Comece. Isso é o que eu fiz. Você pode adicionar o comando ao arquivo .zshrc também. De qualquer forma, saia e reinicie o terminal para as alterações para entrar em vigor.
With macOS Catalina, the default shell is zsh. You can either switch to the /bin/bash shell as explained in Maxim's answer. Or stay with the zsh shell and change the startup run command to say
PROMPT='%/ %# '
The %/ is for full path and %# is to indicate whether the shell is running with privileges. More explanation and the full list of customizations is here.
I found this info here.
You can add the startup run command mentioned above in the 'Run command: ' field at Terminal > Preferences > Profiles > Shell > Startup. This is what I did. You could instead add the command to the .zshrc file as well. Either way, quit and restart the terminal for the changes to take effect.
© 2022 pergunte.org All Rights Reserved. Casa de perguntas e respostas todos os direitos reservados