Code Monkey home page Code Monkey logo

tmux-fzf's Introduction

demo

Features

  • Manage sessions (switch, new, rename, detach, kill).
  • Manage windows (switch, link, move, swap, rename, kill).
  • Manage panes (switch, break, join, swap, layout, kill, resize).
  • Search commands and append to command prompt.
  • Search key bindings and execute.
  • Search clipboard history and paste to current window.
  • Process management (top, pstree, terminate, kill, interrupt, continue, stop, quit, hangup).
  • User menu (run custom commands).
  • Preview sessions, windows and panes.
  • Multiple selection.

Installation

Requirements

  • GNU bash
  • sed
  • junegunn/fzf
  • CopyQ (optional): Access system clipboard, fallback to builtin tmux buffers if copyq is not executable.
  • pstree (optional): Display process tree.

Note: Please use this command to check whether tmux is able to find fzf #1: tmux run-shell -b 'command -v fzf'

Install via TPM

Add this line to your ~/.tmux.conf

set -g @plugin 'sainnhe/tmux-fzf'

Reload configuration, then press prefix + I.

Usage

To launch tmux-fzf, press prefix + F (Shift+F).

This plugin supports multiple selection for some actions, you can press TAB and Shift-TAB to mark multiple items.

Most of the features work out of the box, but there are some features that need to be explained here.

Kill Window(s)

The kill action in tmux-fzf actually uses tmux unlink-window -k instead of tmux kill-window.

The main difference between unlink-window -k and kill-window is that kill-window will kill current window and all other windows linked to it, while unlink-window -k will only kill current window.

The logic of unlink -k is a bit like hard links. If the current window only exists in one session, then kill; if the current window exists in multiple sessions, then unlink.

Btw, if you want to bind a key to kill current window, I would recommend unlink-window -k instead of kill.

User Menu

You can add a custom menu to quickly execute some commands.

This feature is not enabled by default. To enable it, add something like this to ~/.tmux.conf

TMUX_FZF_MENU=\
"foo\necho 'Hello!'\n"\
"bar\nls ~\n"\
"sh\nsh ~/test.sh\n"

When you launch tmux-fzf, an extra item named menu will appear. Selecting this item will produce this.

There will be 3 items to select from: foo, bar and sh.

When you select foo, tmux will execute echo 'Hello!'.

When you select bar, tmux will execute ls ~.

When you select sh, tmux will execute sh ~/test.sh.

Note:

  • foo and echo 'hello' are separated by \n in TMUX_FZF_MENU, and you need to add another \n after echo 'hello'.
  • DO NOT add additional white spaces/tabs at the beginning of each line.
  • Commands are executed using tmux -c, so please make sure tmux -c "your command" does work.

Popup Window

Popup window is a new feature introduced in tmux 3.2 . To enable this feature, you'll need to have tmux >= 3.2 installed.

This feature is automatically enabled in tmux >= 3.2, but you can disable it using $TMUX_FZF_OPTIONS, see Fzf Behavior.

Customization

Key Binding

For example, to use prefix + C-f (Ctrl+F), add this line to your ~/.tmux.conf

TMUX_FZF_LAUNCH_KEY="C-f"

Fzf Behavior

This plugin will read fzf environment variables, so you can use these variables to customize the behavior of fzf (e.g. prompt and color).

In addition, this plugin supports customizing the options of fzf-tmux command which is bundled with fzf, you can customize them by adding something like this to ~/.tmux.conf

# Default value in tmux < 3.2
TMUX_FZF_OPTIONS="-m"

# Default value in tmux >= 3.2
TMUX_FZF_OPTIONS="-p -w 62% -h 38% -m"

To list all available options of fzf-tmux, execute ~/.tmux/plugins/tmux-fzf/scripts/.fzf-tmux --help in your shell.

Preview

Preview is enabled by default. To hide it, add something like this to your ~/.tmux.conf:

TMUX_FZF_PREVIEW=0

Then the preview window will be hidden until toggle-preview is triggered.

Order

To customize the order of the actions, add something like this to your ~/.tmux.conf:

TMUX_FZF_ORDER="session|window|pane|command|keybinding|clipboard|process"

You can also use this variable to disable unwanted features. For example, to disable clipboard and process, simply delete them in $TMUX_FZF_ORDER:

TMUX_FZF_ORDER="session|window|pane|command|keybinding"

Format

For some reasons, you may want to customize format of panes, windows, sessions listed in fzf. There are three variables to complete this work:

TMUX_FZF_PANE_FORMAT TMUX_FZF_WINDOW_FORMAT TMUX_FZF_SESSION_FORMAT

For example, tmux list-panes -a doesn't show running program and window name by default. If you want to show running program and window name, add something like this to ~/.tmux.conf

TMUX_FZF_PANE_FORMAT="[#{window_name}] #{pane_current_command}  [#{pane_width}x#{pane_height}] [history #{history_size}/#{history_limit}, #{history_bytes} bytes] #{?pane_active,[active],[inactive]}"

Similarly, TMUX_FZF_WINDOW_FORMAT and TMUX_FZF_SESSION_FORMAT can also be handled in this way.

For more information, check "FORMATS" section in tmux manual.

Filter

By default, the current session, window, and pane, are not listed among the switch possibilities. To include it, set:

TMUX_FZF_SWITCH_CURRENT=1

When using the window listing script, it is possible to filter its output. This relies on the tmux filtering feature with a specific syntax for filters. For more information about this feature, check "FORMATS" section in the tmux manual.

To use this filtering feature, set the variable TMUX_FZF_WINDOW_FILTER to the filter you want to apply before calling the window.sh script.

FAQ

Q: Why use environment variables instead of tmux options to customize this plugin?

A: Because the performance of tmux options is very bad. I pushed a branch named tmux-options to demonstrate how bad the performance will be if we use tmux options to customize this plugin, you can checkout this branch and get it a try.

Q: How to launch tmux-fzf with preselected action?

A: See #6.

Q: What's your status line configuration?

A: See this post.

Q: What's the color scheme used in the screenshot?

A: Gruvbox Material

More plugins

License

The code of /scripts/.fzf-tmux is copied from junegunn/fzf which is licensed under MIT.

Other code is distributed under MIT && Anti-996.

tmux-fzf's People

Contributors

aacebedo avatar atlas-comstock avatar atomicstack avatar bsteffaniak avatar frostyx avatar hervemartin avatar iloveitaly avatar inoc603 avatar isidroas avatar kruszczynski avatar oliverralbertini avatar rjshrjndrn avatar sainnhe avatar sc0 avatar stonevil avatar timbedard avatar wseng avatar xwjdsh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

tmux-fzf's Issues

`keybinding` gives empty list

This plugin is awesome! I'm using it on my Mac with ZSH, and almost everything works exactly as it's supposed to.

However, when I choose the keybinding option, the list is empty. I thought maybe it was a mismatch between Linux & Mac's version's of sed, but even using gnu-sed it didn't work.

Do you have any ideas what might cause this?

Screen Shot 2021-06-09 at 16 07 41

Won't launch

When ever I try to launch this, I get the following error message:

'/home/my-user-name/.tmux/plugins/tmux-fzf/scripts/.sh' returned 127

I notice the part of the filename before the extension is missing.

I'm running tmux 2.6 on WSL.

Multiple keybinds โ€” library functions?

My primary use, that drove me to search for this, and quickly install it, is for a nicer filter list for pane searching (ideally including tmux's in-buffer search, when searching for panes). Something like tmux choose-tree -w, #20. I'm tempted to restrict or set environment variable defaults, so I can, at one keypress, be interactively fzf filtering panes.

However this tool does a wonderful job to make visible the levels to make better and more full use of tmux. Session control and fzf filtering for keybinds improves on even the upgrades to tmux in version 2 when submit-query filtering of keybinds was made possible. I like these functions that you expose, and want to use them to make better use of all that tmux has to offer.

Does the tmux plugin paradigm support you defining a function where users could write their bindings calling to customized invocations of the function.

bind -n C-S-p tmux-fzf-call 'pane' 'switch' '*'
bind -n C-S-m tmux-fzf-call 'pane' 'switch|move' '*'
bind -n C-S-m tmux-fzf-call 'pane|window' 'create|switch|move' '*'

I want my 1 specialized bind invocation, for now. But I really like to have the API of tmux laid out as a series of choices, I can "choose from a set", which is a nicer problem than "remember the functions available, and their flags and arguments, and compose them correctly in a one-shot prompt line". Thank you!

Quickly jump to session->attach

Hey, thanks for that great plugin. Been using it since a few days.

One thing is bogging me, i usually want to switch to different sessions. So i have to press CTRLb, Enter, Enter just to select the session i want to switch to (session & attach are my defaults for these menues).

Is there a way to open instantly into the session->attach menue? And probably likewise to all other subcategories?

Thanks for your support!

A way to set preview to starting lines

Dear @sainnhe, Thanks for your amazing work on tmux-fzf. I really enjoy using it.

I'm having a preview issue since I first started using the tmux-fzf, that is preview starts in the middle or by the end instead the first line.

Is there away you know of or configuration I missed to make preview start from the first lines

Thanks

missing text format in paste buffer

  • While text is copied into tmux-buffer, text formats like (newline/tabs/spaces) are discarded.
  • So, if you copy full logs you get everything in a single line.
  • Modified below code to retain text formatting.
diff --git a/scripts/clipboard.sh b/scripts/clipboard.sh
index 67a5e98..e2d3015 100755
--- a/scripts/clipboard.sh
+++ b/scripts/clipboard.sh
@@ -23,7 +23,8 @@ if [[ "$action" == "system" ]]; then
     [[ -z "${system_clipboard_history}" ]] && exit
     tmux send-keys -l "${system_clipboard_history}"
 elif [[ "$action" == "buffer" ]]; then
-    buffer_clipboard_history=$(tmux list-buffers | sed -E -e 's/^buffer[^/]*bytes: "//' -e 's/"$//' | eval "$TMUX_FZF_BIN $TMUX_FZF_OPTIONS")
+    buffer_clipboard_history=$(tmux list-buffers | eval "$TMUX_FZF_BIN $TMUX_FZF_OPTIONS")
+    selected_buffer=$(echo $buffer_clipboard_history | cut -d ":" -f1)
     [[ -z "${buffer_clipboard_history}" ]] && exit
-    tmux send-keys -l "${buffer_clipboard_history}"
+    tmux paste-buffer -b $selected_buffer
 fi

Window Switch (omit session name, show only current session windows)

Hi there, thanksssss sooooo much for this plugin and the other cool themes you have added.

I'm using tmux-fzf as a session and a window switcher, and I want to accomplish two things:

  1. Omit session name from window switch
  2. Show only current session windows

My current settings

TMUX_FZF_WINDOW_FORMAT="#{window_name}"
TMUX_FZF_SESSION_FORMAT="#{session_name}"

session name is duplicated in session format

Thanks

Conflict with 'tmux-plugins/tmux-resurrect'

It worked well when I initiated the new tmux server but I couldn't activate the when tmux was reloaded from 'tmux-plugins/tmux-resurrect'

I'm using tmux 3.2a.

Updates:
It showed menu when I ran ~/.tmux/plugins/tmux-fzf/main.sh from shell
but tmux command :run-shell -b ~/.tmux/plugins/tmux-fzf/main.sh didn't work

The fzf window has incomplete borders.

  • OS: Manjaro KDE Plasma kernel 6.1.41-1-MANJARO
  • Tmux version: tmux 3.3a
  • Terminal emulator: yakuake(konsole), alacritty
  • echo $TERM: screen.konsole-256color

yakuake:

Screenshot_20230731_132250

alacritty:

Screenshot_20230731_132632

Removing prefixes for `TMUX_FZF_*_FORMAT`

Currently, session, window and pane formats are displayed after some prefix, like:

"#S:#{window_index}: $TMUX_FZF_WINDOW_FORMAT"

But then we can't remove session names even if we only want to see ${window_name}.
So I suggest removing those prefixes for TMUX_FZF_*_FORMAT so that users get full control:

"$TMUX_FZF_WINDOW_FORMAT"

Thank you.

Add frequently used actions to the user menu not works(Not display)

This is my settings, and the file exists.
I can exec /Users/myname/.tmux/plugins/tmux-fzf/scripts/pane.sh switch and it works well.

TMUX_FZF_MENU=\
"switchpane\n/Users/myname/.tmux/plugins/tmux-fzf/scripts/pane.sh switch\n"\
"switchwindow\n/Users/myname/.tmux/plugins/tmux-fzf/scripts/window.sh switch\n"

However, reload tmux, and prefix+F remains the same.

Any method to debug?

tmux-fzf for buffer list

This would be awesome as then with a quick binding you can pop up a nice "clipboard history" pop-up

tmux-fzf second level menus do not work with fish shell

It seems that the second level menus in tmux-fzf do not work.

Using:

  • fish, version 3.1.2
  • tmux 2.6
  • fzf 0.24.3 (722d66e), from Github

I get to select the first level of menu fine using the shortcut:

image

But then, when pressing on any menu option, the screen blinks and nothing happens.

The fix seems to be quite simple: delete .fzf-tmux from tmux-fzf/scripts and create a symbolic link .fzf-tmux instead, pointing to $HOME/.fzf/bin/fzf-tmux. Once done, everything works fine.

Tmux fzf cannot display

I try press the keys C-Space (my prefix) + F (Shift+f) and tmux fzt cannot display.
this is my .tmux.conf:

# {{{Settings
# ๅฏๅŠจnon-login shell
set -g default-command "${SHELL}"
# ่ฎพ็ฝฎ้ขœ่‰ฒ
set -g default-terminal "tmux-256color"
set -ga terminal-overrides ",*256col*:Tc"
# ้ผ ๆ ‡ๆ”ฏๆŒ
set -g mouse on
# ไธป้ข˜
source ~/.tmux/tmuxline/edge-dark.tmux.conf
# }}}
# {{{Mappings
prefix C-p
unbind C-a
set -g prefix C-Space
bind C-Space send-prefix

# reload config file
bind-key -T prefix r source-file ~/.tmux.conf

# window
bind-key -T prefix C-t new-window
bind-key -T prefix C-w unlink-window -k
bind-key -n C-left prev
bind-key -n C-right next
bind-key -n C-up swap-window -t -1
bind-key -n C-down swap-window -t +1
bind-key -T prefix C-s split-window
bind-key -T prefix C-v split-window -h

# pane
bind-key -T prefix C-h select-pane -L
bind-key -T prefix C-j select-pane -D
bind-key -T prefix C-k select-pane -U
bind-key -T prefix C-l select-pane -R
bind-key -T prefix C-x kill-pane

# copy mode
bind-key -T prefix n copy-mode
bind-key -T copy-mode-vi 'v' send -X begin-selection

# custom
bind-key -T prefix C-b splitw -h -p 40 -b -c '#{pane_current_path}'
# }}}
# {{{Plugins
# {{{tpm-usage
# Other examples:
# set -g @plugin 'github_username/plugin_name'
# set -g @plugin '[email protected]/user/plugin'
# set -g @plugin '[email protected]/user/plugin'
# 
# prefix I   install
# prefix alt-u   uninstall
# prefix U   upgrade
# }}}
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'sainnhe/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'tmux-plugins/tmux-copycat'
set -g @plugin 'tmux-plugins/tmux-prefix-highlight'
set -g @plugin 'tmux-plugins/tmux-net-speed'
set -g @plugin 'samoshkin/tmux-plugin-sysstat'
set -g @plugin 'sainnhe/tmux-fzf'
set -g @plugin 'toddyamakawa/tmux-scratchpad'
run -b '~/.tmux/plugins/tpm/tpm'
# {{{tmux-resurrect
set -g @resurrect-save 'S'
set -g @resurrect-restore 'R'
set -g @resurrect-capture-pane-contents 'on'
# }}}
# {{{tmux-continuum
set -g @continuum-restore 'on'
set -g @resurrect-hook-post-restore-all 'tmux kill-session -t 0'
#}}}
# {{{tmux-plugin-sysstat
set -g @sysstat_cpu_view_tmpl '#[fg=cyan]C:#[default] #[fg=#{cpu.color}]#{cpu.pused}#[default]'
set -g @sysstat_mem_view_tmpl '#[fg=cyan]M:#[default] #[fg=#{mem.color}]#{mem.pused}#[default]'
set -g status-interval 3
# }}}
# {{{tmux-prefix-highlight
set -g @prefix_highlight_fg 'colour00'
set -g @prefix_highlight_bg 'red'
set -g @prefix_highlight_show_copy_mode 'on'
set -g @prefix_highlight_copy_mode_attr 'fg=colour00,bg=colour05,bold'
set -g @prefix_highlight_prefix_prompt 'PREFIX'
set -g @prefix_highlight_copy_prompt 'COPY'
# }}}
# {{{tmux-fzf
TMUX_FZF_OPTIONS="-d 35%"
set -g @tmux-fzf-launch-key "a"
TMUX_FZF_MENU=\
"attach session\n/home/guerrafs/.tmux/plugins/tmux-fzf/scripts/session.sh attach\n"\
"rename window\n/home/guerrafs/.tmux/plugins/tmux-fzf/scripts/window.sh rename\n"
# }}}
# {{{tmux-scratchpad
set-option -g @scratch-command-key 'Tab'
#}}}
# }}}

Border and padding of popup window

Hello and thanks for this plugin!

When I launch the popup window I have an additional border and padding outside of the fzf like in the image below:
image

Is it possible to remove the outside border and padding? Thank you in advance!

Plugin don't expect you to use ESC

sometimes I use ESC to close fzf windows, but with this plugin I get:

'/Users/gioyik/.tmux/plugins/tmux-fzf/scripts/.sh' returned 127

Seems it expects to be closed using the cancel option inside tmux-fzf

Does not seem to respect FZF_DEFAULT_OPTS on macOS Catalina

It does on the first screen, but not on subsequent ones ๐Ÿค” I have fzf options set to have the prompt at the top.

~ ยป  echo $FZF_DEFAULT_OPTS
--height 40% --reverse --color=bg+:#343d46,bg:#2b303b,spinner:#96b5b4,hl:#8fa1b3 --color=fg:#a7adba,header:#8fa1b3,info:#ebcb8b,pointer:#96b5b4 --color=marker:#96b5b4,fg+:#dfe1e8,prompt:#ebcb8b,hl+:#8fa1b3

CleanShot 2021-07-16 at 18 16 53

Feature Request: connect to attached sessions

I run multiple terminal emulators on different workspaces. Often I will want to switch to a tmux session that is already attached in a different workspace. It would be nice if this was supported by tmux-fzf, perhaps via an optional configuration.

wierd behavior of window renaming and switching

Hit there. first thanks for your nice plugin.

when i want to rename a window, sometimes(actually mostly), it does not put the window name in popup automatically. so I set terminal-overrides in my config file to st-256 color. but it had no effect and actually caused some options like window switch don't work under the kitty(other terminal emulator). for example in this situation switch returns the bellow error:
'/home/areza/.tmux/plugins/tmux-fzf/scripts/window.sh' returned 123

the wierd thing actually is that it sometimes works correct under the both of my terminal. i mean it fills the window name automatically and switches to another window without error.

i could not find any question about this on internet and i tried to change the terminal override option to my other terminal(xterm-kitty) and even commenting out this option compeletly but none of them worked and i still get the same behavior.

my os is manjaro and the window manager is dwm. my terminal emulators are st and kitty. also the tmux config file is as bellow:

source /usr/lib/python3.9/site-packages/powerline/bindings/tmux/powerline.conf

set-option -sg escape-time 10
set -g default-terminal "tmux-256color"
set-option -sa terminal-overrides ",st-256color:RGB"

set -g set-clipboard on
set -g mouse off
bind m
set -g mouse on ;
display 'Mouse: ON'
bind M
set -g mouse off ;
display 'Mouse: OFF'

set -g pane-border-style 'fg=cyan bg=default'
set -g pane-active-border-style 'bg=default fg=magenta'

set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'

set -g @plugin 'sainnhe/tmux-fzf' # prefix + shift + F

run '~/.tmux/plugins/tpm/tpm'

i hope i could explaine my question clearly.

`attach` sub command for session.sh

I have this line in my .tmux.conf

bind-key -r o run-shell "~/.tmux/plugins/tmux-fzf/scripts/session.sh \"attach\""

It used to work to directly open a pane including all the sessions and attach to the selected one.
After I updated the tmux plugins it does not work any more, it would open the pane but when I select a session it would do nothing. does the attach sub command got removed? How can I achieve same behavior with the current version?

Support tmux session titles with non alphanumeric characters

Attach session with a non alphanumeric name is not working.
For example : if I select a tmux session named 'private_dotfiles', I get this error :
.tmux/plugins/tmux-fzf/scripts/session.sh' returned 123
I'll submit a PR soon, it's a regexp pb.

Show the current session/window/pane when switching

For some reason, I cannot see the current session, window, and pane when switching. I am not sure whether it is a bug or a feature but it is IMHO very unpleasant.

  • For a second I always panic that I accidentally killed some session
  • Sometimes my hands are faster than my thinking and I start switching into a session without realizing that I am currently in it. Then I am confused why it isn't there
  • The main benefit of fzf is filtering a large number of results with ease, so one less result doesn't make a dent

If this is a feature, can we have have a config variable to optionally show current thing in the fzf items, please?

Session -> New not working with tmux next-3.4

Fedora 39 installs tmux next-3.4, which seems to rename the -p parameter for split-window to -l. Session -> New executes tmux split-window -v -p 30, which fails with size missing. Replacing the -p with -l makes it working again.

<prefix> + Ctrl + F not launching tmux-fzf

possible duplicate of #34

I cannot make it work on Arch Linux. Tmux 3.2a .

I also tried remapping via TMUX_FZF_LAUNCH_KEY="C-f"

fzf is found and is available on the prompt with ctrl + T.

My only other bindings are:

unbind C-b
set-option -g prefix C-a
bind-key C-a last-window

### Allows us to use C-a a <command> to send commands to a TMUX session inside another TMUX session
bind-key a send-prefix 

# Activity monitoring
#setw -g monitor-activity on
#set -g visual-activity on

# Example of using a shell command in the status line
#set -g status-right "#[fg=yellow]#(uptime | cut -d ',' -f 2-)"

# reload config file (change file location to your the tmux.conf you want to use)
bind r source-file ~/.tmux.conf

### split panes using | and -
bind | split-window -h
bind - split-window -v
unbind '"'
unbind %

# Activity monitoring
setw -g monitor-activity on
set -g visual-activity on

# v and y for selection in copy mode
bind-key -T copy-mode-vi 'v' send -X begin-selection
bind-key -T copy-mode-vi 'y' send -X copy-selection-and-cancel
 
# tmux fzf
#TMUX_FZF_LAUNCH_KEY="C-f"

# hjkl pane traversal
bind -n M-h select-pane -L
bind -n M-j select-pane -D
bind -n M-k select-pane -U
bind -n M-l select-pane -R

you cannot pass FZF OPTIONS to TMUX_FZF_OPTIONS

Hey,

This is a great plugin, I have been configuring it for a while and pretty impressed. I tried to push how much the plugin fzf window could be customized and I'm getting behavior that I don't expect. I understand this plugin somewhat depends on the params available in fzf-tmux, so if we check what available we get:

$ fzf-tmux --help                                                                                                     [I]
usage: fzf-tmux [-u|-d [HEIGHT[%]]] [-l|-r [WIDTH[%]]] [--] [FZF OPTIONS]

  Layout
    -u [HEIGHT[%]]  Split above (up)
    -d [HEIGHT[%]]  Split below (down)
    -l [WIDTH[%]]   Split left
    -r [WIDTH[%]]   Split right

    (default: -d 50%)

it says you can pass normal fzf options to fzf-tmux, so if I run the following command:

fzf-tmux -d 25% --prompt=. --color=dark --color=fg:-1,bg:-1,hl:#5fff87,fg+:-1,bg+:-1,hl+:#ffaf5f --color=info:#af87ff,prompt:#5fff87,pointer:#ff87d7,marker:#ff87d7,spinner:#ff87d7

I get an fzf window with changes I set as options in the command, however, when you try to add those to the TMUX_FZF_OPTIONS like this:

TMUX_FZF_OPTIONS="-d 25% --prompt=. --color=dark --color=fg:-1,bg:-1,hl:#5fff87,fg+:-1,bg+:-1,hl+:#ffaf5f --color=info:#af87ff,prompt:#5fff87,pointer:#ff87d7,marker:#ff87d7,spinner:#ff87d7"

But I get an error:

'/Users/gioyik/.tmux/plugins/tmux-fzf/scripts/.sh' returned 127

Not sure if I'm doing it correctly or something is not being parsed correctly inside the plugin.

Can I create a key binding to go right into fzf session attach?

I switch session a bunch and I'd like to be able to hit a single key binding to go right into choosing a session to switch to. It looks like right now I need to:

  1. prefix+F
  2. session
  3. attach
  4. Type session name/prefix

So instead I'd like to skip steps 2 and 3 (for this custom keybinding). Is that possible? I cannot find out how from looking at the documentation.

move-window doesnt work

It return an error , on printing the values :
it generates this :
tmux move-window -a -s session1:2 -t vagrant:4:bash

target doesnt look correct .

copy-mode commands

Thanks for the great plugin!

Would be great to have another menu item for copy-mode commands. Super helpful when learning tmux.

[Feature request] tmuxinator integration

Hello. It would be cool if tmux-fzf will have option to mix opened session with predefined sessions in tmuxinator.
If session is not launched => launch it
If session is launched => attach to it.
Thanks.

Session names that contain spaces are unusable

Specifically, the grep pattern in session.sh

target=$(echo "$target_origin" | grep -o '^[[:alpha:][:digit:]/_-]*:' | sed 's/.$//g')

won't match on sessions such as My Session, as a space (or any whitespace character for that matter) won't be matched under the above character set.

Even if the above was fixed naively by changing to pattern

'^[[:alpha:][:digit:]/_ -]*:'

(there's now a space after the underscore)

The attach (or any action for that matter) will still fail because of xargs:

echo "$target" | xargs tmux switch-client -t

xargs delimits the parameters by space so switch-client sees two arguments instead of one (the session name with the space).
I assume this is written this way to support multi selection, but it doesn't seem to work regardless to me.

Locally I've patched the grep pattern to include space and xargs was removed from the attach command and is now used as

tmux switch-client -t "$target"

and it works.

tmux-fzf doesn't work if ...

I'm using bash + tmux + tpm + 'tmux-fzf' plugin for tmux and I'm using 'oh my tmux' repo for tmux configuration files (.tmux.conf and .tmux.conf.local)
If I put 'list of plugins' scripts into .tmux.conf =====> tmux-fzf works
If I put 'list of plugins' scripts into .tmux.conf.local => tmux-fzf doesn't work

Here is my tpm scripts added to the bottom of my .tmux.conf.local file:
set-environment -g TMUX_PLUGIN_MANAGER_PATH '~/.dotfiles/tmux/plugins'
# ***** list of plugins *****
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'sainnhe/tmux-fzf'
# ***** end: list of plugins *****
run '~/.dotfiles/tmux/plugins/tpm/tpm'

Rename commands would broke if the title contained '/'

Hi,

I found out that the rename command would break if the window title contain /.
My test steps are as below:

tmux new-session -s test
tmux rename-window -t "test:1" "foo/foo"
bash -x ~/.config/tmux/plugins/tmux-fzf/scripts/window.sh

and the log is like this

...
+ target_origin='[current]'
++ echo '[current]'
++ sed -E 's/\[current\]/test:1: foo/foo/'
sed: -e expression #1, char 27: unknown option to `s'
+ target_origin=
+ [[ '' == \[\c\a\n\c\e\l\] ]]
+ [[ -z '' ]]
+ exit

PANE format with padding.

I tried to align columns for better view.

And I tried this config:

TMUX_FZF_PANE_FORMAT="#{p30:#{b:pane_current_path}} :: #{pane_current_command}"

and I found it seems that I can't change the start part of the display format, so the config's result is like:

image

Expect:
image

[Break Change] Use $TMUX_FZF_LAUNCH_KEY

So you've noticed that this plugin uses @tmux-fzf-launch-key to customize the launch key, but uses environment variables to control some other behaviors.

That's because the performance of tmux variables is VERY BAD. I pushed a new branch named tmux-options to demonstrate how bad the performance will be if we use tmux variables. You can checkout this branch and get it a try.

I decided to switch from @tmux-fzf-launch-key to $TMUX_FZF_LAUNCH_KEY partly because of this, another reason is that I don't want to use tmux variables in some places while use environment variables in others, that makes the code and .tmux.conf very dirty.

You need to modify your config if you are using @tmux-fzf-launch-key after 66817c1.

How to shortcut menu

I've just installed this plugin and it looks great.
However, I was wondering, is there a way to do preselect options so I can create a key binding which for example allow me to attach a session without having to select session and then attach ?

tmux: unknown option -- K

Hi, I tried to set this up on my ubuntu with home-manager from nix.

I have fzf installed and tmux is able to see it:

tmux run-shell 'command -v fzf' 
/home/kghost/.nix-profile/bin/fzf

But when I try to invoke fzf-tmux I get this:

ls | /nix/store/rk6vrgamfsnp45kvk2cwhjmjs387691i-tmuxplugin-tmux-fzf-unstable-2020-12-07/share/tmux-plugins/tmux-fzf/scripts/.fzf-tmux
tmux: unknown option -- K
usage: display-popup [-CE] [-c target-client] [-d start-directory] [-h height] [-t target-pane] [-w width] [-x position] [-y position] [command]

my tmux version is: tmux 3.2a

I discovered this because when I press prefix + F nothing happens and hence I started debugging.

Calling

tmux run-shell -b /nix/store/32d5ndb6nasv7ikmlnr3yxg5inh1n0i3-tmuxplugin-tmux-fzf-unstable-2020-12-07/share/tmux-plugins/tmux-fzf/main.sh

does nothing.

How to not include [cancel] in the menu?

I would prefer to not to have [cancel] as one of the options, because I can hit escape to cancel.
Is there a setting that I can use to remove [cancel] as one of the options?

CopyQ clipboard only completes on number, not on content

When the CopyQ history is selected via clipboard, typing only completes on the CopyQ item number and not on the item contents as I would expect and as is the case for other lists:

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                                                          โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ โ”‚
โ”‚                                                          โ”‚                                                      โ”‚ โ”‚
โ”‚                                                          โ”‚                                                      โ”‚ โ”‚
โ”‚                                                          โ”‚                                                      โ”‚ โ”‚
โ”‚                                                          โ”‚                                                      โ”‚ โ”‚
โ”‚                                                          โ”‚                                                      โ”‚ โ”‚
โ”‚                                                          โ”‚                                                      โ”‚ โ”‚
โ”‚                                                          โ”‚                                                      โ”‚ โ”‚
โ”‚                                                          โ”‚                                                      โ”‚ โ”‚
โ”‚                                                          โ”‚                                                      โ”‚ โ”‚
โ”‚                                                          โ”‚                                                      โ”‚ โ”‚
โ”‚                                                          โ”‚                                                      โ”‚ โ”‚
โ”‚                                                          โ”‚                                                      โ”‚ โ”‚
โ”‚                                                          โ”‚                                                      โ”‚ โ”‚
โ”‚                                                          โ”‚                                                      โ”‚ โ”‚
โ”‚   0/94 (0)                                               โ”‚                                                      โ”‚ โ”‚
โ”‚ > fzf                                                    โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

The contents are correct in the "box" to the right:

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚   45                                                     โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ โ”‚
โ”‚   35                                                     โ”‚ set -g @plugin 'sainnhe/tmux-fzf'                    โ”‚ โ”‚
โ”‚   25                                                     โ”‚                                                      โ”‚ โ”‚
โ”‚   15                                                     โ”‚                                                      โ”‚ โ”‚
โ”‚   59                                                     โ”‚                                                      โ”‚ โ”‚
โ”‚   58                                                     โ”‚                                                      โ”‚ โ”‚
โ”‚   57                                                     โ”‚                                                      โ”‚ โ”‚
โ”‚   56                                                     โ”‚                                                      โ”‚ โ”‚
โ”‚   55                                                     โ”‚                                                      โ”‚ โ”‚
โ”‚   54                                                     โ”‚                                                      โ”‚ โ”‚
โ”‚   53                                                     โ”‚                                                      โ”‚ โ”‚
โ”‚   52                                                     โ”‚                                                      โ”‚ โ”‚
โ”‚   51                                                     โ”‚                                                      โ”‚ โ”‚
โ”‚   50                                                     โ”‚                                                      โ”‚ โ”‚
โ”‚ > 5                                                      โ”‚                                                      โ”‚ โ”‚
โ”‚   18/92 (0)                                              โ”‚                                                      โ”‚ โ”‚
โ”‚ > 5                                                      โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Versions:

$ fzf --version
0.29 (devel)
$ copyq --version
CopyQ Clipboard Manager 7.0.0~jammy
Qt: 5.15.3
KNotifications: 5.92.0
Compiler: GCC
Arch: x86_64-little_endian-lp64
OS: Pop!_OS 22.04 LTS
$ (cd ~/.tmux/plugins/tmux-fzf/ && git log -n 1)
commit 51081a2688579228d860b3cb410f4437e857fc6e (HEAD -> master, origin/master, origin/HEAD)
Author: Sainnhe Park <[email protected]>
Date:   Thu Jul 6 06:06:31 2023

    Fix $TMUX_FZF_ORDER when not in copy mode

Toggle `pane switch` directly

Now, I have to press the shortcuts, then goto pane, then goto switch, then I can see the panes, which is too mush typing.

  • I want to have a shortcut to show the switch pane window directly.
    • image

Can I do that?~

Maybe this could be like k9s.. display the pane first, then choose the actions against the selected pane?

Thanks for making this wonderful tool~~~~~

<prefix> + Ctrl + F not launching tmux-fzf

Hi,

I just followed the instructions to install tmux-fzf using TPM. To the best of my knowledge, all requirements are satisfied. I'm running Ubuntu 16. When I ran tmux run-shell -b 'command -v fzf', I got no ouput (but also no error). Not sure if that's the expected behavior.

When I press , then Ctrl+F (shift f), nothing happens.

How should I proceed?

Thanks!

macOS's version of sed doesn't support "-r" flag, but instead "-E"

The workaround is to use gnu-sed from brew, and make sure that the path to the homebrew version is ahead of the system sed. But perhaps you could do some environment detection by seeing whether the sed version available on a users path is one that supports -E or -r?

Love the tool!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.