Skip to content

Commit 3a4b0c8

Browse files
author
Phil Hindman
committed
Remove 'cat -' from logging pipe-pane command
The cat is unnecessary since tmux can pipe directly to ansifilter/sed (or any other program that reads from stdin). If ansifilter/sed weren't being used then cat would be necessary, because pipe-pane needs a command to send the output to.
1 parent b5c5f7b commit 3a4b0c8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

scripts/start_logging.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,19 @@ system_osx() {
1212
}
1313

1414
pipe_pane_ansifilter() {
15-
tmux pipe-pane "exec cat - | ansifilter >> $FILE"
15+
tmux pipe-pane "exec ansifilter >> $FILE"
1616
}
1717

1818
pipe_pane_sed_osx() {
1919
# Warning, very complex regex ahead.
2020
# Some characters below might not be visible from github web view.
2121
local ansi_codes_osx="(\[([0-9]{1,3}((;[0-9]{1,3})*)?)?[m|K]||]0;[^]+|[[:space:]]+$)"
22-
tmux pipe-pane "exec cat - | sed -E \"s/$ansi_codes_osx//g\" >> $FILE"
22+
tmux pipe-pane "exec sed -E \"s/$ansi_codes_osx//g\" >> $FILE"
2323
}
2424

2525
pipe_pane_sed() {
2626
local ansi_codes="(\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]|)"
27-
tmux pipe-pane "exec cat - | sed -r 's/$ansi_codes//g' >> $FILE"
27+
tmux pipe-pane "exec sed -r 's/$ansi_codes//g' >> $FILE"
2828
}
2929

3030
start_pipe_pane() {

0 commit comments

Comments
 (0)