Closed oblitum closed 5 years ago
I've hardcoded the multipane feature with this, please tell what you think, if it should be behind a flag or not, I can make it into a pull:
diff --git a/scripts/tmux-extrakto.sh b/scripts/tmux-extrakto.sh
index 1a161ae..caa6588 100755
--- a/scripts/tmux-extrakto.sh
+++ b/scripts/tmux-extrakto.sh
@@ -59,7 +59,13 @@ function capture() {
# for troubleshooting add
# tee /tmp/stageN | \
# between the commands
- sel=$(tmux capture-pane -pJS ${capture_pane_start} -t ! | \
+ for pane in $(tmux list-panes -F "#{pane_active}:#{pane_id}"); do
+ if [[ $pane =~ '0:' ]]; then
+ captured+=$(tmux capture-pane -pJS ${capture_pane_start} -t ${pane:2})
+ captured+=$'\n'
+ fi
+ done
+ sel=$(echo "$captured" | \
$extrakto -r$extrakto_flags | \
(read line && (echo $line; cat) || echo NO MATCH - use a different filter) | \
$fzf_tool \
It could possibly be made more general too, to go across windows/sessions optionally.
Sounds like a good idea!
I have a few suggestions:
-t !
" pane should be piped last so that its content shows up firstNot sure if going across windows would be useful even if the performance was ok.
Good points. Sadly, I can't figure out how to get the pane_id
of the last active pane (-t !
). I think I need it to exclude it from the loop and put its capture as the last output concatenation, otherwise I'll have to add it twice.
@oblitum see $ACTIVE_PANE
in 454f39f
@laktak cool thanks for that. You may delete the branch now if you want. I'll make that part of the pull (no ETA though).
Would it be possible to search in all panes in the current window?
@laktak I've converted the issue into a pull request.
Sorry, I somehow missed the notification for your commit. Thanks for implementing this feature!
Sometimes I'm with a split of vim and a console. If editing in the vim pane, extrakto doesn't fuzzy find text/paths in the console pane. It would be great if it could do so. Meanwhile I have to select the target console pane, fuzzyfind there and copy, then get to the vim pane and paste.