You are not logged in.

#1 2021-10-04 20:16:15

gca
Member
Registered: 2021-06-08
Posts: 59

[SOLVED] Gnome 4.0 terminal error

Hi,
after updates, opening gnome-terminal return an error:

-bash: declare: PROMPT_COMMAND: not found

hmm

every update something not work anymore...

Last edited by gca (2021-10-05 07:29:30)

Offline

#2 2021-10-04 22:02:15

seth
Member
Registered: 2012-09-03
Posts: 51,046

Re: [SOLVED] Gnome 4.0 terminal error

That looks like garbage in your ~/.bashrc?

Offline

#3 2021-10-05 07:27:07

gca
Member
Registered: 2021-06-08
Posts: 59

Re: [SOLVED] Gnome 4.0 terminal error

Thank you for reply, but .bashrc is ok and is the same from last year.
It's contains only some alias.

Offline

#4 2021-10-05 07:31:48

gca
Member
Registered: 2021-06-08
Posts: 59

Re: [SOLVED] Gnome 4.0 terminal error

Romoved option from gnome-terminal  profile "execute command as login shell".
Something changed in the new build...

Offline

#5 2021-10-05 07:33:34

seth
Member
Registered: 2012-09-03
Posts: 51,046

Re: [SOLVED] Gnome 4.0 terminal error

Well, something™ is making a nonsense call to the shel and the TE trying to set PROMPT_COMMAND seems insane.
Can you run eg. kitty or alacritty (or also xterm if this is an X11 session)?

Btw., https://archlinux.org/packages/extra/x8 … -terminal/ is at gnome-terminal 3.40.3-1 - why does the subject say "gnome 4.0 terminal"?

Edit: aha.
And what was that custom command?

Edit #2: if this was just a setting to run bash as login shell, your profile files become relevant, in particular
/etc/profile, ~/.bash_profile, ~/.bash_login and  ~/.profile

Last edited by seth (2021-10-05 07:37:03)

Offline

#6 2021-10-05 13:01:21

gca
Member
Registered: 2021-06-08
Posts: 59

Re: [SOLVED] Gnome 4.0 terminal error

my .bashrc

#
# ~/.bashrc
#

[[ $- != *i* ]] && return
[[ -f ~/.dircolors ]] && . ~/.dircolors

alias ls='ls --color=auto'
alias cp='cp -p'
alias tlp-stat='sudo tlp-stat'
alias dmesg='sudo dmesg'
alias vi=vim
PS1='\w\[\e[1;34m\]:\[\e[0m\] '

# Boxes mouse adjust
export SDL_VIDEO_X11_DGAMOUSE=0

# Virtualbox
VBOX_USB=usbfs

i do not know what execute, but from yesterday...
and the version is the last Versione 3.40.3

Offline

#7 2021-10-05 13:57:36

seth
Member
Registered: 2012-09-03
Posts: 51,046

Re: [SOLVED] Gnome 4.0 terminal error

seth wrote:

And what was that custom command?

Edit #2: if this was just a setting to run bash as login shell, your profile files become relevant, in particular
/etc/profile, ~/.bash_profile, ~/.bash_login and  ~/.profile

Offline

#8 2021-10-05 16:48:46

gca
Member
Registered: 2021-06-08
Posts: 59

Re: [SOLVED] Gnome 4.0 terminal error

#
# /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

why? error is there... why now? why not past year?
i do not understand... what changed in two days?
why i do not get error while accessing to console?

Offline

#9 2021-10-05 17:59:04

seth
Member
Registered: 2012-09-03
Posts: 51,046

Re: [SOLVED] Gnome 4.0 terminal error

That's not the cause.
https://gitlab.gnome.org/GNOME/vte/-/issues/37
Did vte-common update across the break?

Offline

#10 2021-10-05 18:31:09

gca
Member
Registered: 2021-06-08
Posts: 59

Re: [SOLVED] Gnome 4.0 terminal error

yeah.... mad

[2021-10-04T21:45:41+0200] [ALPM] upgraded vte-common (0.64.2-2 -> 0.66.0-1)

Last edited by gca (2021-10-05 18:31:38)

Offline

#11 2021-10-05 19:05:20

seth
Member
Registered: 2012-09-03
Posts: 51,046

Re: [SOLVED] Gnome 4.0 terminal error

40-  __vte_osc7
41-}
42-
43-if [[ -n "${BASH_VERSION:-}" ]]; then
44-
45:    # Newer bash versions support PROMPT_COMMAND as an array. In this case
46-    # only add the __vte_osc7 function to it, and leave setting the terminal
47-    # title to the outside setup.
48:    # On older bash, we can only overwrite the whole PROMPT_COMMAND, so must
49-    # use the __vte_prompt_command function which also sets the title.
50-
51:    if [[ "$(declare -p PROMPT_COMMAND)" =~ "declare -a" ]]; then
52:	PROMPT_COMMAND+=(__vte_osc7)
53-    else
54:	PROMPT_COMMAND="__vte_prompt_command"
55-    fi
56-
57-elif [[ -n "${ZSH_VERSION:-}" ]]; then
58-    precmd_functions+=(__vte_osc7)
59-fi

It checks the declaration of PROMPT_COMMAND in a subshell but at least in that subshell the variable isn't set. Though the script doesn't look like it'd exit the shell at this point.
Do you only see the error or does gnome-terminal fail to run?

Offline

#12 2021-10-05 19:30:41

rconway
Member
Registered: 2021-10-05
Posts: 2

Re: [SOLVED] Gnome 4.0 terminal error

Same for me, coinciding with the update of `vte-common`...
```
[2021-10-04T20:32:53+0100] [ALPM] upgraded vte-common (0.64.2-2 -> 0.66.0-1)
```

The terminal doesn't fail (for me) but the error at the top is ugly!

Last edited by rconway (2021-10-05 19:40:18)

Offline

#13 2021-10-05 19:38:56

seth
Member
Registered: 2012-09-03
Posts: 51,046

Offline

#14 2021-10-05 19:46:26

gca
Member
Registered: 2021-06-08
Posts: 59

Re: [SOLVED] Gnome 4.0 terminal error

seth wrote:
40-  __vte_osc7
41-}
42-
43-if [[ -n "${BASH_VERSION:-}" ]]; then
44-
45:    # Newer bash versions support PROMPT_COMMAND as an array. In this case
46-    # only add the __vte_osc7 function to it, and leave setting the terminal
47-    # title to the outside setup.
48:    # On older bash, we can only overwrite the whole PROMPT_COMMAND, so must
49-    # use the __vte_prompt_command function which also sets the title.
50-
51:    if [[ "$(declare -p PROMPT_COMMAND)" =~ "declare -a" ]]; then
52:	PROMPT_COMMAND+=(__vte_osc7)
53-    else
54:	PROMPT_COMMAND="__vte_prompt_command"
55-    fi
56-
57-elif [[ -n "${ZSH_VERSION:-}" ]]; then
58-    precmd_functions+=(__vte_osc7)
59-fi

It checks the declaration of PROMPT_COMMAND in a subshell but at least in that subshell the variable isn't set. Though the script doesn't look like it'd exit the shell at this point.
Do you only see the error or does gnome-terminal fail to run?

only prompt error... nothing else...
everything works...

Offline

#15 2021-10-05 19:54:52

gca
Member
Registered: 2021-06-08
Posts: 59

Re: [SOLVED] Gnome 4.0 terminal error

it's work! now it is really solved!
you are the one!!!!!
thank you so much

Last edited by gca (2021-10-05 19:55:03)

Offline

#16 2021-10-05 20:05:15

rconway
Member
Registered: 2021-10-05
Posts: 2

Re: [SOLVED] Gnome 4.0 terminal error

Many thanks. Does the job.

Offline

#17 2021-10-18 08:11:17

omgitsaheadcrab
Member
Registered: 2012-06-21
Posts: 6

Re: [SOLVED] Gnome 4.0 terminal error

Brilliant, thank you!

PS. The file is located in

/etc/profile.d/vte.sh

in case anyone is looking for it.

Offline

#18 2021-12-05 15:28:28

ThePeach
Member
From: Berlin, DE
Registered: 2014-06-08
Posts: 40
Website

Re: [SOLVED] Gnome 4.0 terminal error

Thanks for the solution, but apparently I'm having the same problem exclusively within tmux. and the linked solution does not apply sad

Offline

#19 2021-12-05 15:55:06

seth
Member
Registered: 2012-09-03
Posts: 51,046

Re: [SOLVED] Gnome 4.0 terminal error

The error message is gnome terminal / VTE specific, only triggered if BASH_VERSION is set and by that patch redirected into stdout and that's captured by test to check against the expected output.
I don't see how tmux would come into the mix here - do you get the exact same error and do you only get it when running bash inside tmux inside gnome-terminal (or other VTE variants) an what does your /etc/profile.d/vte.sh look like?

Offline

#20 2021-12-12 08:21:33

ThePeach
Member
From: Berlin, DE
Registered: 2014-06-08
Posts: 40
Website

Re: [SOLVED] Gnome 4.0 terminal error

@seth: exactly. No problems whatsoever with gnome terminal as is, as soon as I start tmux, at the start or after the output of every single command I issue on any terminal the following:

-bash: __vte_prompt_command: command not found

Offline

#21 2021-12-12 08:51:00

seth
Member
Registered: 2012-09-03
Posts: 51,046

Re: [SOLVED] Gnome 4.0 terminal error

That's *not* the same error at all. It's still because gnome is developed by some running Dunning-Kruger effects, but the problem is different.

You're likely starting tmux from an interactive bash inside a VTE terminal to begin with. The PROMPT_COMMAND in tmux/bash gets inherited, but the vte.sh isn't sourced, resp. the __vte_prompt_command() function not defined in that context.

=> You need to either unset the $PROMPT_COMMAND (before running tmux or inside) or patch the vte.sh to test eg.

# TERM not supported?
case "$TERM" in
    xterm*|vte*|gnome*|screen) :;;
    *) return 0 ;;
esac

(assuming your tmux sets $TERM to screen) so that __vte_prompt_command() gets defined (but idk. whether it'll still work properly through tmux)

Offline

Board footer

Powered by FluxBB