tmux-sessionx icon indicating copy to clipboard operation
tmux-sessionx copied to clipboard

Added an option to ignore prefix

Open alihammad-gist opened this issue 2 years ago • 6 comments

This pull request adds an option @sessionx-prefix (on by default) which when set to off, will ignore tmux's prefix key when binding a key to launch sessionx popup. The following configuration maps Ctrl+s to launch sessionx popup.

set -g @sessionx-bind 'C-s'
set -g @sessionx-prefix off

alihammad-gist avatar Dec 10 '23 16:12 alihammad-gist

@alihmm @alihammad-gist Cool! Can you add this to the readme please and I'll merge? Thanks!

omerxx avatar Dec 11 '23 17:12 omerxx

@omerxx Added a little description for the option @session-prefix in read me.

alihammad-gist avatar Dec 17 '23 20:12 alihammad-gist

Thanks! Lots of markdown auto fixed it seems like title line breaks and cleaning empty spaces. Are you using a plugin / LSP of some sort for that?

omerxx avatar Dec 17 '23 21:12 omerxx

Yes, using prettier as a vim filter for formatting. These formatters use some sort of standard formatting so you don't have to memorize what goes where. Prettier is pretty handy cuz it supports a lot of filetypes including markdown. It's available on npm. Btw great plugin, especially the revised design is a lot better.

alihammad-gist avatar Dec 18 '23 00:12 alihammad-gist

@alihammad-gist Gotcha. Care to fix the conflicts so I could merge?

omerxx avatar Jan 03 '24 11:01 omerxx

I was looking at this PR and I liked the idea but I saw that it wasn't merged due to the conflicts, is there a plan to fix this? If necessary, I can open a new pr implementing this

the-spanish-guy avatar Jan 23 '24 18:01 the-spanish-guy

@the-spanish-guy all done. @alihammad-gist thank you! I'd be happy if you can review the changes (although merged) just to see I didn't miss anything when fixing the additional conflicts.

omerxx avatar Sep 17 '24 11:09 omerxx

I reviewed the changes on my machine. Here are my findings. When @session-prefix setting is not set or it is set to 'on' (lowercase) only, the tmux prefix key must be pressed before @sessionx-bind key to trigger sessionx. For all other values of @session-prefix the prefix is not needed. Should this be the other way around? Only ignore tmux prefix when @session-prefix is set to off for all other values it should be required?

You haven't missed anything, I added a few lines of code and a paragraph of documentation which is included in the commit. I have a few suggestions. Wouldn't it be more appropriate to have configuration values in the documentation be set to the 'default' values? For example (below) @sessionx-filter-current should be set to true in the documentation.

# By default, the current session will not be shown on first view
# This is to support quick switch of sessions
# Only after other actions (e.g. rename) will the current session appear
# Setting this option to 'false' changes this default behavior
set -g @sessionx-filter-current 'false'

@omerxx I can submit PRs for these changes if you want.

alihammad-gist avatar Sep 17 '24 18:09 alihammad-gist