Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resizing Terminal Prompt Window Causing Spacing Issues #13

Open
rickarubio opened this issue Jan 12, 2014 · 8 comments
Open

Resizing Terminal Prompt Window Causing Spacing Issues #13

rickarubio opened this issue Jan 12, 2014 · 8 comments

Comments

@rickarubio
Copy link

If I resize my terminal window so that the current path I'm on is split between two lines, then typing causes strange behavior.

Example:

rr@Macintosh ~/dropbox/Source_Code/dev_bootcamp/phase1/week1/sudoku-2-guessing-challenge (rickr)*$ l                 s

instead of:

rr@Macintosh ~/dropbox/Source_Code/dev_bootcamp/phase1/week1/sudoku-2-guessing-challenge (rickr)*$ ls

@james-ingold
Copy link

+1 I'm having this issue as well.

@jimeh
Copy link
Owner

jimeh commented Mar 12, 2015

I'm gonna have a look at this within the next day or two. Mind telling me what OS, terminal app, and PS1 config you have set?

@srvanrell
Copy link

@jimeh I don't know how to inform you about PS1 config, what do you need to know? the file where I put git-aware-prompt's code?.

  • uname give me this: Linux srvanrell-pc 3.13.0-46-generic #77-Ubuntu SMP Mon Mar 2 18:23:39 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
  • I use both gnome terminal and default terminal and git-aware-prompt is working whithout troubles.

@jimeh
Copy link
Owner

jimeh commented Mar 12, 2015

@srvanrell You don't get a spacing issue when resizing the terminal window?

@srvanrell
Copy link

My prompt looks like this:

srvanrell@srvanrell-pc ~ $ echo "I'm not at a git project's folder"

srvanrell@srvanrell-pc ~/myproject (master)*$ echo "inside myproject's folder"

@jimeh
Copy link
Owner

jimeh commented Mar 12, 2015

@srvanrell Doesn't look like this issue applies to you.

@joeytwiddle
Copy link

This is a very common issue that comes up when you use colours in your prompt but you forget to escape them properly. @rickarubio @james-ingold

If you guys have edited the colours in your prompt, be sure that every colour code has been wrapped in the escaped brackets:

\[$txtgrn\]

You cannot place colours in the script itself (prompt.sh), or you will suffer from the wrapping issues described. Colour codes must go in the prompt string (PS1) properly escaped. The script can only generate dynamic text, not dynamic colours.

It's a limitation with bash and zsh, but limitations can be a catalyst for creativity. @mikeweilgart and I discussed this recently, but I can't find our conversation now.

Hope this helps. Otherwise I've just been barking up the wrong tree(ish).

@mikeweilgart
Copy link

(Here is the conversation mentioned above by @joeytwiddle .)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants