How to fix the prompt?

jian he jian.universality at gmail.com
Wed Aug 31 15:02:22 UTC 2022


Hi there.

The following script is trying to change the prompt. part of /etc/profile.
The  problem is I need to  source /etc/profile every time I open a new pane
in tmux.
Is there any simple way to change the prompt permanently?

if [ "${PS1-}" ]; then
  if [ "${BASH-}" ] && [ "$BASH" != "/bin/sh" ]; then
    # The file bash.bashrc already sets the default PS1.
    # PS1='\h:\w\$ '
    if [ -f /etc/bash.bashrc ]; then
      . /etc/bash.bashrc
    fi
  else
    if [ "$(id -u)" -eq 0 ]; then
      PS1='# '
    else
      PS1='$ '
    fi
  fi
fi

if [ -d /etc/profile.d ]; then
  for i in /etc/profile.d/*.sh; do
    if [ -r $i ]; then
      . $i
    fi
  done
  unset i
fi

------
version  info:
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.1 LTS
Release:        22.04
Codename:       jammy
-------

-- 
 I recommend David Deutsch's <<The Beginning of Infinity>>

  Jian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20220831/82b4393c/attachment.html>


More information about the ubuntu-users mailing list