Skip to content

Commit fb82d88

Browse files
authored
fix: remove ANSI sequences from captured buffer (#53)
1 parent 28ed7ce commit fb82d88

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fzf-url.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ limit='screen'
3232
[[ $# -ge 2 ]] && limit=$2
3333

3434
if [[ $limit == 'screen' ]]; then
35-
content="$(tmux capture-pane -J -p -e)"
35+
content="$(tmux capture-pane -J -p -e |sed -r 's/\x1B\[[0-9;]*[mK]//g'))"
3636
else
37-
content="$(tmux capture-pane -J -p -e -S -"$limit")"
37+
content="$(tmux capture-pane -J -p -e -S -"$limit" |sed -r 's/\x1B\[[0-9;]*[mK]//g'))"
3838
fi
3939

4040
urls=$(echo "$content" |grep -oE '(https?|ftp|file):/?//[-A-Za-z0-9+&@#/%?=~_|!:,.;]*[-A-Za-z0-9+&@#/%=~_|]')

0 commit comments

Comments
 (0)