Skip to content

Commit 763d0a8

Browse files
authored
Merge pull request #54 from Freed-Wu/master
Fix #53
2 parents de290b3 + e0d9d1c commit 763d0a8

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

open.tmux

+7-3
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,20 @@ get_editor_from_the_env_var() {
3434
fi
3535
}
3636

37+
preserve_url_hash() {
38+
echo "sed s/##/####/g"
39+
}
40+
3741
command_generator() {
3842
local command_string="$1"
39-
echo "xargs -I {} tmux run-shell -b 'cd #{pane_current_path}; $command_string \"{}\" > /dev/null'"
43+
echo "$(preserve_url_hash) | xargs -I {} tmux run-shell -b 'cd #{pane_current_path}; $command_string \"{}\" > /dev/null'"
4044
}
4145

4246
search_command_generator() {
4347
local command_string="$1"
4448
local engine="$2"
4549

46-
echo "sed 's/\ /+/g' | xargs -I {} tmux run-shell -b 'cd #{pane_current_path}; $command_string $engine\"{}\" > /dev/null'"
50+
echo "$(preserve_url_hash) | sed 's/\ /+/g' | xargs -I {} tmux run-shell -b 'cd #{pane_current_path}; $command_string $engine\"{}\" > /dev/null'"
4751
}
4852

4953
generate_open_command() {
@@ -80,7 +84,7 @@ generate_editor_command() {
8084
local editor=$(get_tmux_option "$open_editor_override" "$environment_editor")
8185
# vim freezes terminal unless there's the '--' argument. Other editors seem
8286
# to be fine with it (textmate [mate], light table [table]).
83-
echo "xargs -I {} tmux send-keys '$editor -- \"{}\"'; tmux send-keys 'C-m'"
87+
echo "$(preserve_url_hash) | xargs -I {} tmux send-keys '$editor -- \"{}\"'; tmux send-keys 'C-m'"
8488
}
8589

8690
set_copy_mode_open_bindings() {

0 commit comments

Comments
 (0)