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

Failover to default completions #2

Open
truthdoug opened this issue Sep 13, 2016 · 2 comments
Open

Failover to default completions #2

truthdoug opened this issue Sep 13, 2016 · 2 comments

Comments

@truthdoug
Copy link

Problem: When I try to write the tmux copy buffer to a file, tab completion doesn't work for the file name.

I copied text in my tmux session and tried redirect the output tmux show-buffer to append it to an existing file, like this:

$ tmux show-buffer >> /tmp/mylog.txt

I typed /tmp/m and hit tab to complete the filename but nothing happened.

The fix is to change this line:

complete -F _tmux tmux

to:

complete -o bashdefault -F _tmux tmux

The bash man page says -o bashdefault will "Perform the rest of the default bash completions if the compspec generates no matches."

@imomaliev
Copy link
Owner

Hello. Yes. I specifically disabled this option because it was completing other commands where it shouldn't have.

For filecompletion you can read more there
http://stackoverflow.com/questions/14343464/bash-completion-after-redirection-symbol#14343925

Also if it is only case for show-buffer, I can enable file completion for it explicitly.

@truthdoug
Copy link
Author

Ah, interesting - I wasn't familiar with the complete-filename option although I use that key combination for completion in emacs.

I've only encountered this when trying show-buffer. I can't think of other tmux commands for which I would want to redirect output.

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

2 participants