Skip to content

Commit 78143f3

Browse files
committed
FIX: Multi-line search text should be passed as a joined single argument, not one search per line
For opening files, it makes sense to assume line-based input (i.e. one file per line), but when doing web searches, we'd rather have the whole text passed as-is. Many error messages and stack traces span multiple lines! This gets rid of the xargs, but we can also drop the chdir to the pane's CWD; unlike filespecs, the web search argument is not dependent on the current path (and the search command most likely is found through PATH).
1 parent 3befb3b commit 78143f3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

open.tmux

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ search_command_generator() {
3636
local command_string="$1"
3737
local engine="$2"
3838

39-
echo "xargs -I {} tmux run-shell -b 'cd #{pane_current_path}; $command_string $engine\"{}\" > /dev/null'"
39+
echo "$command_string \"$engine\$(cat)\" >/dev/null"
4040
}
4141

4242
generate_open_command() {

0 commit comments

Comments
 (0)