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

PWD segment not working #112

Closed
pablox-cl opened this issue Dec 19, 2012 · 7 comments
Closed

PWD segment not working #112

pablox-cl opened this issue Dec 19, 2012 · 7 comments

Comments

@pablox-cl
Copy link

First, the pwd.sh segment is missing a line sourcing lib/tmux_adapter.sh

# Source lib to get the function get_tmux_pwd
source "${TMUX_POWERLINE_DIR_HOME}/lib/tmux_adapter.sh"

(before that, running with bash -x throws an error saying the get_tmux_cwd function doesn't exist).

I would add it myself, but I'm not sure if the functionality is right.

First, I added the line on my PS1 variable.

When I open tmux, nothing happens, if I open a new window, the cwd appears, but if I navigate through other directories, the segment never updates, if I travel to a different directory and then I create a new window, the segment updates on every window and doing some random changes.

Maybe I'm not understanding what the segment does, but afaik it suppose to show the current directory, so it should be changing every time I cd into one.

@erikagnvall
Copy link
Collaborator

I've added the line sourcing lib/tmux_adapter.sh in f3a73a2 as well as fixed some other bugs.

Not sure what the other problem is caused by, the only thing that comes to mind is what you've set the status-interval to in ~/.tmux.conf. This regulates how often the status line updates. There will always be some delay before the pwd segment updates when you cd in to a directory but having a slow update interval might give the symptoms you describe.

The segments work fine for me, when I open tmux it appears and when I switch between windows it updates with the correct directory displayed.

Another thing to make sure is that you don't overwrite the PS1 variable after the line you added that is supposed to save the cwd (see issue #52).

You can make sure you added the correct line to PS1 by entering [prefix] : in tmux (Ctrl-a : in my case, Ctrl-b : if you haven't changed from the default) to enter command mode and then type show-environment and hit enter. You want to se a list of tmux environment variables with some TMUXPWD_n_n listed, something like this:

...
TMUXPWD_0_0=/Users/erik/src/tmux-powerline
TMUXPWD_1_0=/Users/erik/src
...

Depending on how many tmux panes you have.

@erikw
Copy link
Owner

erikw commented Jan 2, 2013

Did you solve the problem?

@pablox-cl
Copy link
Author

Nope, I just pulled the master branch and got a lot of changes, but I'm finding the same issues. I created a term in codestre.am to see if it's easy to show this weird behaviour:

http://codestre.am/d77f18f54b075013df4f13bed

Vim colours look awful, but hey it's codestre.am fault :P

@erikw
Copy link
Owner

erikw commented Jan 7, 2013

I noticed in your ~/.zshrc that you're using the old line from the README that used tmux's #I_#P but a while ago I (or someone, don't remember) found that tmux has a #D that should give a unique number for each pane. Update that and try again.

Cool codestream, the video inspired 979f31a :-)

@pablox-cl
Copy link
Author

Hahaha, thanks! It's quite long though :(. The good thing about it is that is quicker than the segment :P.

About the commit, note that the #F it's not needed, because of this:

set -g window-status-format "#I:#W"
set -g window-status-current-format "#[fg=colour235]⮀#[fg=default] #I ⮁ #W #[fg=colour61,bg=colour235]⮀"

Just having the all-awesome powerline window, it's clear enough which one
it's the active window, so no "*" it's needed.

You are right, now it works perfectly. I am closing the issue :).

@erikw
Copy link
Owner

erikw commented Jan 9, 2013

That is true, 64e8e5e.

@pablox-cl
Copy link
Author

On 9 January 2013 01:38, Erik Westrup notifications@github.com wrote:

That is true, 64e8e5ehttps://github.com/erikw/tmux-powerline/commit/64e8e5ec52a4f12a2548c08f65d6c47d66964733
.

=)

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

3 participants