Bash: declare: PROMPT_COMMAND: not found (ERROR)

Greetings lovely community,

Just ran some updates earlier today and I noticed whenever I open up my favorite terminal Tilix, I get the following error on the very first line:

bash: declare: PROMPT_COMMAND: not found

Screenshot from 2021-10-05 12-23-56

Normally, that error on the first line shouldn’t be showing up at all, so I thought this was odd. I don’t know if it might help at all, but in my .bashrc file, the only change I’ve done there is added neofetch on the last line to make it autostart whenever I open a new Tilix terminal.

If it helps at all, I’ll post my .bashrc file and also my pacman transaction history from the last 24 hours in case any packages might be the cause of this. If I need to file a bug anywhere please let me know and if you need any other sort of logs from me please let me know. I don’t know if anyone else is experiencing this issue from today’s updates as well or if it’s just me?

My .bashrc file:

#
# ~/.bashrc
#

# If not running interactively, don't do anything
[[ $- != *i* ]] && return

[[ -f ~/.welcome_screen ]] && . ~/.welcome_screen

_set_my_PS1() {
    PS1='[\u@\h \W]\$ '
    if [ "$(whoami)" = "liveuser" ] ; then
        local iso_version="$(grep ^VERSION= /usr/lib/endeavouros-release 2>/dev/null | cut -d '=' -f 2)"
        if [ -n "$iso_version" ] ; then
            local prefix="eos-"
            local iso_info="$prefix$iso_version"
            PS1="[\u@$iso_info \W]\$ "
        fi
    fi
}
_set_my_PS1
unset -f _set_my_PS1

ShowInstallerIsoInfo() {
    local file=/usr/lib/endeavouros-release
    if [ -r $file ] ; then
        cat $file
    else
        echo "Sorry, installer ISO info is not available." >&2
    fi
}


alias ls='ls --color=auto'
alias ll='ls -lav --ignore=..'   # show long listing of all except ".."
alias l='ls -lav --ignore=.?*'   # show long listing but no hidden dotfiles except "."

[[ "$(whoami)" = "root" ]] && return

[[ -z "$FUNCNEST" ]] && export FUNCNEST=100          # limits recursive functions, see 'man bash'

## Use the up and down arrow keys for finding a command in history
## (you can write some initial letters of the command first).
bind '"\e[A":history-search-backward'
bind '"\e[B":history-search-forward'

################################################################################
## Some generally useful functions.
## Consider uncommenting aliases below to start using these functions.


_GeneralCmdCheck() {
    # A helper for functions UpdateArchPackages and UpdateAURPackages.

    echo "$@" >&2
    "$@" || {
        echo "Error: '$*' failed." >&2
        exit 1
    }
}

_CheckInternetConnection() {
    # curl --silent --connect-timeout 8 https://8.8.8.8 >/dev/null
    eos-connection-checker
    local result=$?
    test $result -eq 0 || echo "No internet connection!" >&2
    return $result
}

_CheckArchNews() {
    local conf=/etc/eos-update-notifier.conf

    if [ -z "$CheckArchNewsForYou" ] && [ -r $conf ] ; then
        source $conf
    fi

    if [ "$CheckArchNewsForYou" = "yes" ] ; then
        local news="$(yay -Pw)"
        if [ -n "$news" ] ; then
            echo "Arch news:" >&2
            echo "$news" >&2
            echo "" >&2
            # read -p "Press ENTER to continue (or Ctrl-C to stop): "
        else
            echo "No Arch news." >&2
        fi
    fi
}

UpdateArchPackages() {
    # Updates Arch packages.

    _CheckInternetConnection || return 1

    _CheckArchNews

    #local updates="$(yay -Qu --repo)"
    local updates="$(checkupdates)"
    if [ -n "$updates" ] ; then
        echo "Updates from upstream:" >&2
        echo "$updates" | sed 's|^|    |' >&2
        _GeneralCmdCheck sudo pacman -Syu "$@"
        return 0
    else
        echo "No upstream updates." >&2
        return 1
    fi
}

UpdateAURPackages() {
    # Updates AUR packages.

    _CheckInternetConnection || return 1

    local updates
    if [ -x /usr/bin/yay ] ; then
        updates="$(yay -Qua)"
        if [ -n "$updates" ] ; then
            echo "Updates from AUR:" >&2
            echo "$updates" | sed 's|^|    |' >&2
            _GeneralCmdCheck yay -Syua "$@"
        else
            echo "No AUR updates." >&2
        fi
    else
        echo "Warning: /usr/bin/yay does not exist." >&2
    fi
}

UpdateAllPackages() {
    # Updates all packages in the system.
    # Upstream (i.e. Arch) packages are updated first.
    # If there are Arch updates, you should run
    # this function a second time to update
    # the AUR packages too.

    UpdateArchPackages || UpdateAURPackages
}


_open_files_for_editing() {
    # Open any given document file(s) for editing (or just viewing).
    # Note1: Do not use for executable files!
    # Note2: uses mime bindings, so you may need to use
    #        e.g. a file manager to make some file bindings.

    if [ -x /usr/bin/exo-open ] ; then
        echo "exo-open $*" >&2
        /usr/bin/exo-open "$@" >& /dev/null &
        return
    fi
    if [ -x /usr/bin/xdg-open ] ; then
        for file in "$@" ; do
            echo "xdg-open $file" >&2
            /usr/bin/xdg-open "$file" >& /dev/null &
        done
        return
    fi

    echo "Sorry, none of programs [$progs] is found." >&2
    echo "Tip: install one of packages" >&2
    for prog in $progs ; do
        echo "    $(pacman -Qqo "$prog")" >&2
    done
}

_Pacdiff() {
    local differ pacdiff=/usr/bin/pacdiff

    if [ -n "$(echo q | DIFFPROG=diff $pacdiff)" ] ; then
        for differ in kdiff3 meld diffuse ; do
            if [ -x /usr/bin/$differ ] ; then
                DIFFPROG=$differ su-c_wrapper $pacdiff
                break
            fi
        done
    fi
}
neofetch

#------------------------------------------------------------

## Aliases for the functions above.
## Uncomment an alias if you want to use it.
##

# alias ef='_open_files_for_editing'     # 'ef' opens given file(s) for editing
# alias pacdiff=_Pacdiff
################################################################################

And also here’s my pacman transaction history just from the last 24 hours:

[2021-10-05T10:45:15-0500] [ALPM] upgraded python-pylast (4.2.1-1 -> 4.3.0-1)
[2021-10-05T10:45:14-0500] [ALPM] upgraded firefox (92.0.1-1 -> 93.0-1)
[2021-10-05T08:26:32-0500] [ALPM] upgraded popsicle-git (1.3.0.r44.gda43ab9-1 -> 1.3.0.r45.g3ace3a8-1)
[2021-10-05T08:08:14-0500] [ALPM] upgraded libopenmpt (0.5.11-1 -> 0.5.12-1)
[2021-10-05T07:53:33-0500] [ALPM] upgraded yelp-tools (40.0-1 -> 41.0-1)
[2021-10-05T07:53:33-0500] [ALPM] upgraded yelp-xsl (40.2-1 -> 41.0-1)
[2021-10-05T07:53:33-0500] [ALPM] upgraded vte3 (0.64.2-2 -> 0.66.0-1)
[2021-10-05T07:53:33-0500] [ALPM] upgraded vte-common (0.64.2-2 -> 0.66.0-1)
[2021-10-05T07:53:33-0500] [ALPM] upgraded vala (0.54.1-1 -> 0.54.2-1)
[2021-10-05T07:53:33-0500] [ALPM] upgraded tracker-miners (2.3.5+2+gec09554af-2 -> 2.3.5+2+gec09554af-3)
[2021-10-05T07:53:33-0500] [ALPM] upgraded qt5-declarative (5.15.2+kde+r31-1 -> 5.15.2+kde+r32-1)
[2021-10-05T07:53:32-0500] [ALPM] upgraded networkmanager-openvpn (1.8.14-1 -> 1.8.16-1)
[2021-10-05T07:53:32-0500] [ALPM] upgraded nautilus (40.2-1 -> 40.2+7+g67c7bdbf8-1)
[2021-10-05T07:53:32-0500] [ALPM] upgraded libphonenumber (8.12.29-1 -> 8.12.33-1)
[2021-10-05T07:53:32-0500] [ALPM] upgraded libnautilus-extension (40.2-1 -> 40.2+7+g67c7bdbf8-1)
[2021-10-05T07:53:32-0500] [ALPM] upgraded gnome-photos (40.0-1 -> 40.0+14+g884b1fd1-1)
[2021-10-05T07:53:32-0500] [ALPM] upgraded tracker3-miners (3.2.0+6+gfffef2772-1 -> 3.2.0+6+gfffef2772-2)
[2021-10-05T07:53:32-0500] [ALPM] upgraded gegl (0.4.32-1 -> 0.4.32-2)
[2021-10-05T07:53:32-0500] [ALPM] upgraded openexr (3.1.1-1 -> 3.1.2-1)
[2021-10-05T07:53:32-0500] [ALPM] upgraded libgexiv2 (0.12.3-1 -> 0.14.0-1)
[2021-10-05T07:53:32-0500] [ALPM] upgraded eos-apps-info (1.1-1 -> 1.1-3)
[2021-10-05T07:53:32-0500] [ALPM] upgraded libsoup3 (3.0.0-2 -> 3.0.1-1)
[2021-10-04T13:34:02-0500] [ALPM] upgraded fribidi (1.0.10-1 -> 1.0.11-1)
[2021-10-04T13:29:16-0500] [ALPM] upgraded nss (3.70-1 -> 3.71-1)
[2021-10-04T13:29:16-0500] [ALPM] upgraded ca-certificates-mozilla (3.70-1 -> 3.71-1)
[2021-10-04T13:14:52-0500] [ALPM] upgraded systemd-sysvcompat (249.4-1 -> 249.4-2)
[2021-10-04T13:14:52-0500] [ALPM] upgraded r8168 (8.049.02-23 -> 8.049.02-25)
[2021-10-04T13:14:52-0500] [ALPM] upgraded linux-zen-headers (5.14.8.zen1-1 -> 5.14.9.zen2-1)
[2021-10-04T13:14:50-0500] [ALPM] upgraded linux-zen (5.14.8.zen1-1 -> 5.14.9.zen2-1)
[2021-10-04T13:14:48-0500] [ALPM] upgraded linux-headers (5.14.8.arch1-1 -> 5.14.9.arch2-1)
[2021-10-04T13:14:45-0500] [ALPM] upgraded linux (5.14.8.arch1-1 -> 5.14.9.arch2-1)
[2021-10-04T13:14:43-0500] [ALPM] upgraded hexchat (2.14.3-9 -> 2.16.0-1)
[2021-10-04T13:14:42-0500] [ALPM] upgraded eos-apps-info (1.0.12-1 -> 1.1-1)
[2021-10-04T13:14:42-0500] [ALPM] upgraded systemd (249.4-1 -> 249.4-2)
[2021-10-04T13:14:42-0500] [ALPM] upgraded systemd-libs (249.4-1 -> 249.4-2)
[2021-10-04T07:07:52-0500] [ALPM] installed ffaudioconverter (0.30.0-1)
[2021-10-04T07:03:10-0500] [ALPM] upgraded qt5-base (5.15.2+kde+r228-1 -> 5.15.2+kde+r234-1)
[2021-10-04T07:03:09-0500] [ALPM] upgraded libnewt (0.52.21-5 -> 0.52.21-6)
[2021-10-04T03:21:59-0500] [ALPM] upgraded libvirt (1:7.7.0-1 -> 1:7.8.0-1)
[2021-10-04T03:21:59-0500] [ALPM] upgraded imagemagick (7.1.0.8-1 -> 7.1.0.9-1)
[2021-10-04T03:21:59-0500] [ALPM] upgraded tzdata (2021b-1 -> 2021c-1)
[

Can we see the contents of /etc/bash.bashrc

1 Like

sudo nano /etc/bash.bashrc

  GNU nano 5.8                                                                           /etc/bash.bashrc                                                                                      
#
# /etc/bash.bashrc
#

# If not running interactively, don't do anything
[[ $- != *i* ]] && return

[[ $DISPLAY ]] && shopt -s checkwinsize

PS1='[\u@\h \W]\$ '

case ${TERM} in
  xterm*|rxvt*|Eterm|aterm|kterm|gnome*)
    PROMPT_COMMAND=${PROMPT_COMMAND:+$PROMPT_COMMAND; }'printf "\033]0;%s@%s:%s\007" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/\~}"'

    ;;
  screen*)
    PROMPT_COMMAND=${PROMPT_COMMAND:+$PROMPT_COMMAND; }'printf "\033_%s@%s:%s\033\\" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/\~}"'
    ;;
esac

[ -r /usr/share/bash-completion/bash_completion   ] && . /usr/share/bash-completion/bash_completion


Just a quick update, I did some searching around and stumbled onto this recent thread from a few days ago: https://bbs.archlinux.org/viewtopic.php?pid=1996345

While I didn’t understand what their solution in that post was (they just posted a link to what looked like a merge request maybe?), I did see a comment over there mentioning a setting called “Run command as login shell” which is an option inside Tilix preferences. Pretty sure it’s an option in Gnome Terminal as well. For whatever reason I had that option turned on, and by turning it off, the error message at the top of my terminal window went away. So while not a true “fix” per se, since the underlying issue is more than likely still present, at least for now I don’t see the error message show up anymore.

If the “Run command as a login shell” is turned off here, the error won’t show:
Screenshot from 2021-10-05 18-42-32

With the option from above turned off, the Tilix terminal functions again just like how I’d like it to:
Screenshot from 2021-10-05 18-42-52

@dalto Like I said, I don’t know if this is a solution or more just a workaround, but for now that’s all I got! :wink:

From reading that topic, it looks like the actual fix has been committed in vte so when that fix makes it into an actual release of vte it should resolve the long-term issue.

1 Like

Yeah thanks for checking that out and verifying that, very much appreciated. I’ll keep my eye out for any new vte or vte-common package update and see if the issue gets resolved from the update :slight_smile: