You are not logged in.

#1 2010-11-04 20:40:57

valvet
Member
From: Denmark
Registered: 2009-06-06
Posts: 147

[SOLVED] Bash prompts and bell characters

Hello

This is kinda hard to explain, but I'll give a shot - with a couple of screenshots.

vNjFvcw

vNjFvdA

Notice the terminal on the left, and also at the bottom.. whenever I type in a command (or paste from somewhere) that's longer than xx characters, and hit "END" to edit the command, it goes all the way to the start of the line - but visually it's leaving the character behind, so it's impossible to see where you're editing. I suppose it has something to do with my terminal size (even tho "fullscreen" in Xmonad).

Other than that, I can't figure out why it does it, but it's really anoying.

.Xdefaults
http://codepad.org/U2VSyAUR

Thanks for any help.

Last edited by valvet (2010-11-07 18:30:05)

Offline

#2 2010-11-06 20:58:31

valvet
Member
From: Denmark
Registered: 2009-06-06
Posts: 147

Re: [SOLVED] Bash prompts and bell characters

Still working on this..

Offline

#3 2010-11-06 21:01:53

Mr.Elendig
#archlinux@freenode channel op
From: The intertubes
Registered: 2004-11-07
Posts: 4,092

Re: [SOLVED] Bash prompts and bell characters

what package? rxvt-unicode or rxvt-unicode-256color? If you are using the former, then try switching to the later.


Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest

Offline

#4 2010-11-06 21:10:45

linux-ka
Member
From: ADL
Registered: 2010-05-07
Posts: 232

Re: [SOLVED] Bash prompts and bell characters

That's strange. I am using xmonad and rxvt-unicode-256color too, but there's no problem. I am running the current version of both of 'em. Have you upgraded xmonad/-contrib? or try to build your rxvt version on your own machine.

Offline

#5 2010-11-06 22:15:55

valvet
Member
From: Denmark
Registered: 2009-06-06
Posts: 147

Re: [SOLVED] Bash prompts and bell characters

Hi

At a concert, so short answer. Im using 256 colors version. The latest. Will try normal rxvt ucode when i get home.

Offline

#6 2010-11-07 02:00:57

valvet
Member
From: Denmark
Registered: 2009-06-06
Posts: 147

Re: [SOLVED] Bash prompts and bell characters

Hi

Back home. I just tried both urxvt-unicode, aswell as compiling it myself (also 256 colors).

michael@swamp ~/dev/abs/rxvt-unicode-256color> ppacman -Qi rxvt-unicode-256color
Name           : rxvt-unicode-256color
Version        : 9.07-10
URL            : http://software.schmorp.de/pkg/rxvt-unicode.html
Licenses       : GPL2
Groups         : None
Provides       : rxvt-unicode
Depends On     : gcc-libs  libxft
Optional Deps  : gtk2-perl: for urxvt-tabbed usage
Required By    : None
Conflicts With : rxvt-unicode
Replaces       : None
Installed Size : 2844.00 K
Packager       : Unknown Packager
Architecture   : i686
Build Date     : Sun 07 Nov 2010 02:55:11 AM CET
Install Date   : Sun 07 Nov 2010 02:57:44 AM CET
Install Reason : Explicitly installed
Install Script : Yes
Description    : a unicode enabled rxvt-clone terminal emulator (urxvt), with 256 colour support

It still happens. Notice the extra "p" in pacman.. weird. I'm getting nowhere fast.

Offline

#7 2010-11-07 02:03:38

valvet
Member
From: Denmark
Registered: 2009-06-06
Posts: 147

Re: [SOLVED] Bash prompts and bell characters

linux-ka wrote:

That's strange. I am using xmonad and rxvt-unicode-256color too, but there's no problem. I am running the current version of both of 'em. Have you upgraded xmonad/-contrib? or try to build your rxvt version on your own machine.

Also, yes - my xmonad stuff should be up to date.

Name           : xmonad-darcs
Version        : 20101103-1
URL            : http://hackage.haskell.org/package/xmonad
Licenses       : custom:BSD3
Groups         : None
Provides       : None
Depends On     : gmp  libxinerama  ghc  haskell-x11>=1.5.0.0  haskell-mtl
Optional Deps  : None
Required By    : xmonad-contrib-darcs
Conflicts With : xmonad
Replaces       : None
Installed Size : 4404.00 K
Packager       : Unknown Packager
Architecture   : i686
Build Date     : Wed 03 Nov 2010 11:13:51 PM CET
Install Date   : Wed 03 Nov 2010 11:14:03 PM CET
Install Reason : Explicitly installed
Install Script : Yes
Description    : A tiling window manager
Name           : xmonad-contrib-darcs
Version        : 20101103-1
URL            : http://hackage.haskell.org/package/xmonad-contrib
Licenses       : custom:BSD3
Groups         : None
Provides       : None
Depends On     : haskell-x11-xft  xmonad-darcs
Optional Deps  : None
Required By    : None
Conflicts With : xmonad-contrib
Replaces       : None
Installed Size : 26100.00 K
Packager       : Unknown Packager
Architecture   : i686
Build Date     : Wed 03 Nov 2010 11:16:53 PM CET
Install Date   : Wed 03 Nov 2010 11:17:21 PM CET
Install Reason : Explicitly installed
Install Script : Yes
Description    : Third party extensions for xmonad

Could you try with my Xdefaults file above, see if you can reproduce it? Also try using the font I am (Droid).

Thanks

Last edited by valvet (2010-11-07 02:04:57)

Offline

#8 2010-11-07 02:34:23

skottish
Forum Fellow
From: Here
Registered: 2006-06-16
Posts: 7,942

Re: [SOLVED] Bash prompts and bell characters

You may want to check to see if it happens in another terminal like xterm. If so, you should check your prompt formatting for errors.

Offline

#9 2010-11-07 10:31:49

linux-ka
Member
From: ADL
Registered: 2010-05-07
Posts: 232

Re: [SOLVED] Bash prompts and bell characters

Hm, I have got sth in my mind...it remembers me a problem I had with the keyboad input. Just to foreclose a terminal issue...could you retry these tests with an other terminal like aterm or xterm.

If this issue still exists, try to downgrade your input packages (keyboard..I guess)

EDIT:

:-) someone was faster with terminal suggestions.

Last edited by linux-ka (2010-11-07 10:33:26)

Offline

#10 2010-11-07 12:21:08

valvet
Member
From: Denmark
Registered: 2009-06-06
Posts: 147

Re: [SOLVED] Bash prompts and bell characters

It appears to be a problem with the bash prompt (PS1). Removed it from .bashrc, and now I can't seem to reproduce it.

I don't really care about prompts, but I don't see anything wrong here:

# prompt
PS1='\u@\h \w> \a'

# show [SH] when entering shell in VIM
if [ $VIM ]; then
    export PS1='[SH] \u@\h \w> \a'
fi

Offline

#11 2010-11-07 12:44:51

valvet
Member
From: Denmark
Registered: 2009-06-06
Posts: 147

Re: [SOLVED] Bash prompts and bell characters

After a little more digging, the culprit is the \a I have in my PS1. The reason I have this, is because xmonad/dzen is set up with urgent notification, and if I do eg. pacman -Syu and move to another workspace, it'll notify me whenever it's done with that command because of the \a in the PS1.

Any ideas how to fix this/another solution?

Offline

#12 2010-11-07 16:50:13

skottish
Forum Fellow
From: Here
Registered: 2006-06-16
Posts: 7,942

Re: [SOLVED] Bash prompts and bell characters

I'm not very familiar with prompt programming, but I think that the proper solution is to have non-printing characters in a block at the beginning of the line. This seems to be a fairly complete guide:

http://networking.ringofsaturn.com/Unix … rompts.php

Offline

#13 2010-11-07 17:30:08

valvet
Member
From: Denmark
Registered: 2009-06-06
Posts: 147

Re: [SOLVED] Bash prompts and bell characters

skottish wrote:

I'm not very familiar with prompt programming, but I think that the proper solution is to have non-printing characters in a block at the beginning of the line. This seems to be a fairly complete guide:

http://networking.ringofsaturn.com/Unix … rompts.php

Hi

I just tried doing \a at the start of the prompt instead - sadly, it results in the same problem, as if it were at the end :x.

Offline

#14 2010-11-07 17:44:39

skottish
Forum Fellow
From: Here
Registered: 2006-06-16
Posts: 7,942

Re: [SOLVED] Bash prompts and bell characters

Did you try using something like this or did you just try '\a'?

 [ \a \] 

Offline

#15 2010-11-07 17:47:21

valvet
Member
From: Denmark
Registered: 2009-06-06
Posts: 147

Re: [SOLVED] Bash prompts and bell characters

skottish wrote:

Did you try using something like this or did you just try '\a'?

 [ \a \] 

I tried both.. with and without spaces etc., with the [ \a \] it's now 2 letters that's being left behind, instead of one with just \a.. weird :-).

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

Offline

#16 2010-11-07 17:51:05

skottish
Forum Fellow
From: Here
Registered: 2006-06-16
Posts: 7,942

Re: [SOLVED] Bash prompts and bell characters

I'm out of ideas. Hopefully someone with strong PS1 knowledge will jump in.

Offline

#17 2010-11-07 18:31:03

valvet
Member
From: Denmark
Registered: 2009-06-06
Posts: 147

Re: [SOLVED] Bash prompts and bell characters

skottish wrote:

I'm out of ideas. Hopefully someone with strong PS1 knowledge will jump in.

It actually appears to work after all. I was missing a \ infront of the first bracket [, so it'll look like:

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

So far no issues. Thanks for helping :-)

Offline

#18 2010-11-07 18:39:01

hbekel
Member
Registered: 2008-10-04
Posts: 311

Re: [SOLVED] Bash prompts and bell characters

It doesn't matter where the \a is in the prompt string, since it's a non-printing character. But as such, it needs to be properly escaped, as detailed in man bash, section PROMPTING.

This is not "strong PS1 knowledge". Reading the manual is all it takes.

Offline

Board footer

Powered by FluxBB