Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

In some of my projects, I keep a var or a lib folder for runtime output and external libraries. To keep my prompt rather short, I have the export PROMPT_DIRTRIM=3 option in my .bashrc.

This works very well for most paths, but as soon as I have a /var in there, it goes nuts like this (for ~/Projects/someproject/var/gfx):

~/.../gfxr/gfxr/gfxr/gfxr/gfxr/gfx

Interestingly, it works with /opt/lampp/lib

Is there some way to get around this?

share|improve this question
    
I'm getting ~/.../foo/var/foo. If you have edited your ~/.bashrc, please add its content to the question (you can use paste.ubuntu.com). –  htorque Jun 20 '11 at 18:28
    
I included the relevant files. –  queueoverflow Jun 20 '11 at 18:58
    
Are you still looking for help or have you solved this problem? If this question no longer applies then you can either delete it or answer it yourself if you've solved the problem. Thanks! –  coversnail Apr 13 '12 at 7:44
    
Nope, the problem is still there … –  queueoverflow Apr 14 '12 at 10:53
    
Is the problem still there with a latest version (12.04 or higher) and if so, can you provide more information to your question or anything else you have done in the past months to test or fix the issue. –  Luis Alvarado Mar 14 '13 at 15:24
add comment

1 Answer 1

Do you see the same problem if you run PS1='\w\$ '? I suspect it's your scmpromt function that's causing issues, since it appears to output ansi escapes that's not enclosed in \[ and \]. See http://mywiki.wooledge.org/BashFAQ/053

share|improve this answer
    
I encounter the same problem: mu@Martin-iMac:~/...lersllersllersllersllersllers $ becomes just ~/...lersllersllersllersllersllers$. –  queueoverflow Jul 31 '11 at 20:00
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.