Interactive search of tmux sessions and windows with synchronize-panes on
I use this tmux-configuration based on the post from bartj3 in [1].
bind j split-window -v "tmux list-sessions -F '#S' | fzf --reverse | xargs tmux switch-client -t"
bind k split-window -v "tmux list-window -F '#W' | fzf --reverse | xargs tmux select-window -t"
It let's you interactively (search-as-you-type) search for other sessions and windows by name and therefore switch between them more efficiently.
PROBLEM:
If you use the above while synchronize-panes is on, your search key-strokes will also type in the other (non-search-)panes.
QUESTION:
Does anyone have an idea on how to limit the key-strokes to the search-pane?
[1] Interactive search of tmux sessions
search tmux
add a comment |
I use this tmux-configuration based on the post from bartj3 in [1].
bind j split-window -v "tmux list-sessions -F '#S' | fzf --reverse | xargs tmux switch-client -t"
bind k split-window -v "tmux list-window -F '#W' | fzf --reverse | xargs tmux select-window -t"
It let's you interactively (search-as-you-type) search for other sessions and windows by name and therefore switch between them more efficiently.
PROBLEM:
If you use the above while synchronize-panes is on, your search key-strokes will also type in the other (non-search-)panes.
QUESTION:
Does anyone have an idea on how to limit the key-strokes to the search-pane?
[1] Interactive search of tmux sessions
search tmux
add a comment |
I use this tmux-configuration based on the post from bartj3 in [1].
bind j split-window -v "tmux list-sessions -F '#S' | fzf --reverse | xargs tmux switch-client -t"
bind k split-window -v "tmux list-window -F '#W' | fzf --reverse | xargs tmux select-window -t"
It let's you interactively (search-as-you-type) search for other sessions and windows by name and therefore switch between them more efficiently.
PROBLEM:
If you use the above while synchronize-panes is on, your search key-strokes will also type in the other (non-search-)panes.
QUESTION:
Does anyone have an idea on how to limit the key-strokes to the search-pane?
[1] Interactive search of tmux sessions
search tmux
I use this tmux-configuration based on the post from bartj3 in [1].
bind j split-window -v "tmux list-sessions -F '#S' | fzf --reverse | xargs tmux switch-client -t"
bind k split-window -v "tmux list-window -F '#W' | fzf --reverse | xargs tmux select-window -t"
It let's you interactively (search-as-you-type) search for other sessions and windows by name and therefore switch between them more efficiently.
PROBLEM:
If you use the above while synchronize-panes is on, your search key-strokes will also type in the other (non-search-)panes.
QUESTION:
Does anyone have an idea on how to limit the key-strokes to the search-pane?
[1] Interactive search of tmux sessions
search tmux
search tmux
asked Jan 22 at 23:19
s3_s3_
31
31
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
You can save the current state of synchronize-panes
before calling fzf
, and then restore it to on
afterwards if necessary. For example, this works for me, using bash as the default shell:
bind-key k split-window -v '
if [[ $(tmux show-window-option synchronize-panes) == *on ]];
then tmux set-window-option -q synchronize-panes off;
restore="tmux set-window-option -q synchronize-panes on";
fi;
tmux list-windows -F "#W" | fzf --reverse | xargs tmux select-window -t;
$restore'
Since this is a long shell command, it can be split over many lines provided they each end with a backslash, and shell semi-colons (;) are used as if it was all on one line. You might prefer to put this as a shell script in a file in your PATH and call it instead.
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1397211%2finteractive-search-of-tmux-sessions-and-windows-with-synchronize-panes-on%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
You can save the current state of synchronize-panes
before calling fzf
, and then restore it to on
afterwards if necessary. For example, this works for me, using bash as the default shell:
bind-key k split-window -v '
if [[ $(tmux show-window-option synchronize-panes) == *on ]];
then tmux set-window-option -q synchronize-panes off;
restore="tmux set-window-option -q synchronize-panes on";
fi;
tmux list-windows -F "#W" | fzf --reverse | xargs tmux select-window -t;
$restore'
Since this is a long shell command, it can be split over many lines provided they each end with a backslash, and shell semi-colons (;) are used as if it was all on one line. You might prefer to put this as a shell script in a file in your PATH and call it instead.
add a comment |
You can save the current state of synchronize-panes
before calling fzf
, and then restore it to on
afterwards if necessary. For example, this works for me, using bash as the default shell:
bind-key k split-window -v '
if [[ $(tmux show-window-option synchronize-panes) == *on ]];
then tmux set-window-option -q synchronize-panes off;
restore="tmux set-window-option -q synchronize-panes on";
fi;
tmux list-windows -F "#W" | fzf --reverse | xargs tmux select-window -t;
$restore'
Since this is a long shell command, it can be split over many lines provided they each end with a backslash, and shell semi-colons (;) are used as if it was all on one line. You might prefer to put this as a shell script in a file in your PATH and call it instead.
add a comment |
You can save the current state of synchronize-panes
before calling fzf
, and then restore it to on
afterwards if necessary. For example, this works for me, using bash as the default shell:
bind-key k split-window -v '
if [[ $(tmux show-window-option synchronize-panes) == *on ]];
then tmux set-window-option -q synchronize-panes off;
restore="tmux set-window-option -q synchronize-panes on";
fi;
tmux list-windows -F "#W" | fzf --reverse | xargs tmux select-window -t;
$restore'
Since this is a long shell command, it can be split over many lines provided they each end with a backslash, and shell semi-colons (;) are used as if it was all on one line. You might prefer to put this as a shell script in a file in your PATH and call it instead.
You can save the current state of synchronize-panes
before calling fzf
, and then restore it to on
afterwards if necessary. For example, this works for me, using bash as the default shell:
bind-key k split-window -v '
if [[ $(tmux show-window-option synchronize-panes) == *on ]];
then tmux set-window-option -q synchronize-panes off;
restore="tmux set-window-option -q synchronize-panes on";
fi;
tmux list-windows -F "#W" | fzf --reverse | xargs tmux select-window -t;
$restore'
Since this is a long shell command, it can be split over many lines provided they each end with a backslash, and shell semi-colons (;) are used as if it was all on one line. You might prefer to put this as a shell script in a file in your PATH and call it instead.
answered Jan 27 at 18:38
meuhmeuh
3,65511021
3,65511021
add a comment |
add a comment |
Thanks for contributing an answer to Super User!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1397211%2finteractive-search-of-tmux-sessions-and-windows-with-synchronize-panes-on%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown