1

When I use the terminal command on macOS, the cursor is always left at left margin of the window. I think there must a problem with the prompt ending in a CR or the .zshrc file might be in the wrong format. The prompt I think I am using is

PS1="\T \W: "

My .zshrc is

export PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:$HOME/development/flutter/bin
# export PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:
alias ll="ls -alo"
alias lsa="ls -alo"
alias l="ls -lcoStG"
alias lsd="ls -dl"
alias lsdm="ls -lt"
alias edab="open ~/.zshrc"
alias bsz="source ~/.zshrc"
alias lab="cat /Users/steve/.bashrc"

#git stuff
alias gs="git status"
alias gc="git commit -m "
alias ga="git add -A"
alias gl="git log"

PS1="\T \W: "

  • Rather than speculating, can you do `echo $PS1` and confirm what your actual prompt variable is? – Erwin Jun 23 '22 at 20:22
  • 2
    @Erwin That won't show nonprinting characters. Use `declare -p PS1` or `printf '%s' "$PS1" | xxd` instead. – Gordon Davisson Jun 23 '22 at 21:48
  • 1
    Your PS1 assignment is odd. AFIK, the zsh prompt expansion does not know \T or \W. Still, you should see the colon in the prompt. In any case, I suggest that you set PS1 to something more common, for instance `PS1=%d:`, and see whether this solves your problem. – user1934428 Jun 24 '22 at 06:58

1 Answers1

0

I reformatted the file to remove the 0x0A that were part of the end-of-line sequence. This was the only problem. Thanks for answering.

The weird prompt was from BASH not ZSH.