Only show basename pwd in prompt, not full path #41

Closed
croaky opened this Issue Jul 27, 2012 · 3 comments

2 participants

@croaky
thoughtbot, inc. member

No description provided.

@mike-burns mike-burns was assigned Jul 27, 2012
@croaky
thoughtbot, inc. member

@mike-burns I tried changed changing the ~ on line 20 of zlogin to use basename pwd a few different ways but was seeing some weird behavior. Any hints? Having a hard time reading that line, too. Would be cool to break it apart into named pieces if possible.

@mike-burns
thoughtbot, inc. member

The ~ is actually %~. According to the zsh prompt expansion documentation, you want %1~ to get the basename.

Also, you cannot use ' around PS1. In general, you want to use " around your shell variables.

@croaky
thoughtbot, inc. member

Niiiice. Thanks, Mike. $1~ worked beautifully. Thanks for the zsh prompt expansion documentation.

I think the inner " is why the ' is being used. Switching the outer to " and inner to ' resulted in a funky effect.

@croaky croaky closed this Jul 27, 2012
@alexgodin alexgodin added a commit to alexgodin/dotfiles that referenced this issue Aug 3, 2012
@croaky croaky [#41] Use basename $PWD in shell prompt 67bd1f2
@alexkroman alexkroman added a commit to alexkroman/dotfiles-thoughtbot that referenced this issue Sep 30, 2012
@croaky croaky [#41] Use basename $PWD in shell prompt 1ad1af4
@shouser shouser pushed a commit to shaithus/dotfiles that referenced this issue Nov 16, 2012
@croaky croaky [#41] Use basename $PWD in shell prompt bb5c283
@shouser shouser pushed a commit to shaithus/dotfiles that referenced this issue Nov 16, 2012
@croaky croaky [#41] Use basename $PWD in shell prompt 4f347ed
@ghoppe ghoppe pushed a commit to ghoppe/dotfiles that referenced this issue Dec 17, 2013
@croaky croaky [#41] Use basename $PWD in shell prompt 4ecb705
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment