tmux-plugins/tmux-sidebar

Pane auto closes as soon as I hit Prefix + Tab

JosephFerano opened this issue · 17 comments

As soon as I hit this prefix, I see the split show up and then immediately close. Is there anything in my conf that might be affecting this? I'm on OSX 10.9.5 with iTerm2, fish shell, tmux 1.9a, and tree installed.

Here's my conf;

# remap prefix to Control + q
set -g prefix C-s
unbind C-b
bind C-s send-prefix

# Display
set -g status-bg blue
set -g status-fg white
set -g default-terminal "screen-256color"

# Copy mode
set-option -g default-command "reattach-to-user-namespace -l fish"
setw -g mode-keys vi
bind-key -t vi-copy v begin-selection
bind-key -t vi-copy y copy-pipe "reattach-to-user-namespace pbcopy"
unbind -t vi-copy Enter
bind-key -t vi-copy Enter copy-pipe "reattach-to-user-namespace pbcopy"

# Custom bindings
bind-key x kill-pane
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
bind v copy-mode
bind Up resize-pane -U 10
bind Down resize-pane -D 10
bind Left resize-pane -L 10
bind Right resize-pane -R 10

# Open new windows/panes with current dir
bind '"' split-window -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
bind c new-window -c "#{pane_current_path}"

# Plugins
set -g @tpm_plugins "         \
  tmux-plugins/tpm            \
  tmux-plugins/tmux-open      \
  tmux-plugins/tmux-resurrect      \
  tmux-plugins/tmux-sidebar      \
"
set -g @resurrect-processes 'shh cmus weechat mutt'

# Initializes TMUX plugin manager.
# Keep this line at the very bottom of tmux.conf.
run-shell ~/.tmux/plugins/tpm/tpm

Hi, thanks for trying out the plugin.

Hmm.. could this be due to less program config? How does your LESS environment variable looks like? To get this in the shell type echo $LESS.

Less has this -F or --quit-if-one-screen option where it quits automatically if the output is less than one screen tall. Since tmux-open uses less as the default pager, this could easily be the issue.

Thanks for the help. When I type that in fish, I get a blank line, so I guess there aren't any options set?
I'll google the less program and see if what I find, I'll keep you updated. Thanks.

I tried updating less with brew and it's still doing the same thing.

Hm.. that's unusual.
How about changing the "viewer". Did you try that?

Here's a setting to change the default viewer to vim's view. Also tree-command is updated so that color option (-C) is not used.

set -g @sidebar-tree-pager 'view -'
set -g @sidebar-tree-command 'tree'

Any luck with this?

Yes, changing it to view fixes it however, I'm getting some escape characters showing up. Other than that, it's kind of working fine now. The command "more" doesn't work either, just an FYI.

Hey,
okay, at least we've moved from the dead spot.
The escape characters are showing up because the tree command had the default to also colorize the output. less command handled colorized output well, view apparently not so much.

Also, while testing the plugin for this issue, I've noticed more command doesn't work if the output is less than one screen. From what I see, more just exits in that case, and the sidebar automatically closes. So yea, this is not what we want.

Here are the changes I've made:

  • using more is no longer suggested in the readme
  • default command: tree -C command (-C flag is for colorize, it's creating the escape codes) has been changed to plain tree without the -C flag. That way things should work nicely with other pagers.

So, I think updating the plugin should fix the escape codes.
Not sure how to fix less. The sidebar does work snappier with it...

Thanks for the patience and sorry for the shaky experience with the plugin so far.

I'm getting this now;

Sun Nov  9 20:27:38 2014 '/Users/josephferano/.tmux/plugins/tmux-sidebar/scripts/toggle.sh 'tree -C | view -,left,80' '%59'' returned 1

I'm using fish shell, by the way. I noticed that all of that is bash. Could that be causing these issues?

B.T.W. I'm a little new to shell environments, but learning fast. Also, keep up the good work. I haven't commended you for the plugin and I don't want to come off as unappreciative. Great job!

I am in the same situation. I switched to fish and the same problem appeared. Sidebar autocloses with both shortcuts, tab and backspace. $LESS is not defined neither in fish neither in bash, but sidebar appears in bash and not in fish

@petermehle, thanks for reporting.

Can you please paste or link the output of $ tmux list-keys command?

Also, how does the output of this command look like:

$ tree | LESS= less --dumb --chop-long-lines --tilde --IGNORE-CASE --RAW-CONTROL-CHARS

What is expected of this last command:

  • the tree command output should be shown inside less pager
  • less pager should "take over" the screen, not exit. In other words, after the command is executed, you should be able to press j or k to move up/down over the output

I'm going to try using fish in the meantime.

tmux list-keys: https://dl.dropboxusercontent.com/u/1249135/keys.txt

In bash it works, in fish there is an error. Fish uses 'set' for variables

I installed fish and tried executing the above command. This is the error I got:

fish: Unknown command 'LESS='. Did you mean to run less with a modified environment? Try 'env LESS= less…'. See the help section on the set
command by typing 'help set'.
tree | LESS= less --dumb --chop-long-lines --tilde --IGNORE-CASE --RAW-CONTROL-CHARS

So yea, prepending env works. Or I guess set would work too as you said..

I think changing this based on the $SHELL is a no-go. I think the likely solution will be to execute this in a sub shell like sh -c "tree | LESS= ...". I'm open to other approaches..

My shell skills are are pretty limited, so I am of no help unfortunately :(

BTW, great plugins, great work! They push tmux to the next level of awesomeness!

Hey,
I implemented the fix and things seem to work fine with fish shell now.
Can you please pull the latest plugin version and see if everything works for you too?

BTW, great plugins, great work! They push tmux to the next level of awesomeness!

I'm glad you like the plugins!

It looks like everything works now, thx for the fix so quick :) Great!

Awesome!