You are not logged in.

#1 2018-09-23 17:58:44

theKeen
Member
Registered: 2018-09-03
Posts: 6

Bash prompt behaving weirdly [SOLVED]

Hi all, first post here.

I recently installed Arch for my second time, and my bash prompt is ... off.

I went into my .bashrc and commented out my PS1, and that didn't help. Here's what shows up:

\u009D0;USERNAME@HOSTNAME:~\u009C\u009D7;file://HOSTNAME/home/USERNAME\u009C[USERNAME@HOSTNAME ~]$

Here's my .bashrc:

#
# ~/.bashrc
#

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

alias ls='ls --color=auto'

#green=$(tput setaf 2)
#blue=$(tput setaf 4)
#bold=$(tput bold)
#reset=$(tput sgr0)
#PS1="\n\[$green$bold\]\h\[$reset\]:\[$blue$bold\]\w\[$reset\]\$ "

I've tried search engines, and they have failed me.

Any ideas?

Last edited by theKeen (2018-09-23 20:08:54)

Offline

#2 2018-09-23 18:09:21

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: Bash prompt behaving weirdly [SOLVED]

Please use code tags when pasting to the boards: https://wiki.archlinux.org/index.php/Co … s_and_code


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2018-09-23 18:43:57

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,541
Website

Re: Bash prompt behaving weirdly [SOLVED]

Please post your ~/.bash_profile and the outout of `pacman -Qkk bash`.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#4 2018-09-23 19:14:31

theKeen
Member
Registered: 2018-09-03
Posts: 6

Re: Bash prompt behaving weirdly [SOLVED]

bash_profile:

#
# ~/.bash_profile
#

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

`pacman -Qkk bash`:

bash: 235 total files, 0 altered files

Offline

#5 2018-09-23 19:20:19

loqs
Member
Registered: 2014-03-06
Posts: 19,113

Re: Bash prompt behaving weirdly [SOLVED]

The output of `echo $PS1` please

Offline

#6 2018-09-23 19:52:38

theKeen
Member
Registered: 2018-09-03
Posts: 6

Re: Bash prompt behaving weirdly [SOLVED]

`echo $PS1`:

[\u@\h \W]$ 

Offline

#7 2018-09-23 19:53:59

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,541
Website

Re: Bash prompt behaving weirdly [SOLVED]

and `echo $PROMPT_COMMAND`?  I suspect you have the wrong TERM settings so the title is comming out on the comand line rather than the window title.

Last edited by Trilby (2018-09-23 19:54:43)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#8 2018-09-23 19:54:32

theKeen
Member
Registered: 2018-09-03
Posts: 6

Re: Bash prompt behaving weirdly [SOLVED]

By the way, sorry for taking so long to reply. I'm a bit busy right now, but replies should be relatively quick from now on.

Offline

#9 2018-09-23 19:56:52

theKeen
Member
Registered: 2018-09-03
Posts: 6

Re: Bash prompt behaving weirdly [SOLVED]

`echo $PROMPT_COMMAND`:

__vte_prompt_command; printf "\033]0;%s@%s:%s\007" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/\~}"

I think you've found the error.

Offline

#10 2018-09-23 20:03:40

theKeen
Member
Registered: 2018-09-03
Posts: 6

Re: Bash prompt behaving weirdly [SOLVED]

Okay, I solved the problem.

I simply added the line

PROMPT_COMMAND=""

to my .bashrc file, and all is good!

Thanks for your help, everyone.

Offline

#11 2018-09-23 20:32:35

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,541
Website

Re: Bash prompt behaving weirdly [SOLVED]

That's a decent workaround - but you'd be far better off figuring out what is *causing* the problem as it may cause other problems down the line.

Are you using some shell configuration package, plugin, or extension - or did you copy and paste someone elses configs?

Last edited by Trilby (2018-09-23 20:33:33)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#12 2018-09-23 22:07:43

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,839

Re: Bash prompt behaving weirdly [SOLVED]

"__vte_prompt_command;" - I'm gonna say the VTE. Try in eg. xterm.

Online

#13 2018-09-23 22:20:18

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,541
Website

Re: Bash prompt behaving weirdly [SOLVED]

Yup - I wasn't thinking this at first as I hadn't realized that /etc/bash.bashrc only appends to PROMPT_COMMAND (rather than setting it).  But still, I can't imagine a VTE would set a prompt command that would not work with that VTE.  So I gather TERM is being set somewhere such that it breaks the way the VTE title is set.

Last edited by Trilby (2018-09-23 22:21:13)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

Board footer

Powered by FluxBB