1
0
Fork
You've already forked ejoin
0
Re-join lines based on Emacs style backslash line continuation indicators
  • Go 100%
Find a file
2026年04月23日 13:26:00 -07:00
ejoin.go initial commit 2024年12月26日 16:40:38 -08:00
go.mod initial commit 2024年12月26日 16:40:38 -08:00
README.md Add sed snippet as an alternative. 2026年04月23日 13:26:00 -07:00

ejoin as a very simple program to re-join lines based on Emacs style backslash (\) line continuation markers.

I use it to extract URLs from terminal emulators that support piping the current terminal pane into an external script, for example st with the externalpipe patch or foot's pipe-command-output option.

Example pipelines using xurls:

# Open an URL selected using dmenu
ejoin | xurls | tac | uniq | dmenu -i -l 20 -w $WINDOWID | xargs -r browse.sh
# Open the last URL
ejoin | xurls | tail -n 1 | xargs -r browse.sh
# Open all URLs
ejoin | xurls | uniq | xargs -r browse.sh

Alternative implementation using sed:

sed ':a;N;s/\\\n//;ta;P;D'