Skip to content

ansi and control code filtering #67

Open
@hack-char

Description

@hack-char

I am using Kali rolling, and the default ansi and control code filtering doesn't seem to work well. Doing the following seems to provide the best log review experience:
Do not install ansi-filter
Comment out the sed line trying to remove ansi/control codes in .tmux/plugins/tmux-logging/scripts/start_logging.sh

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

To review log files use 'ansi2txt' (from 'colorized-logs' package):

ansi2txt < ./tmux-ansifilter-test-3-0-0-20230628T123947.log| less

this leaves a few things like '^M' and '^G' in the display, but makes the log more understandable and complete in my opinion
Might be best to incorporate ansi2txt into start_logging.sh but I haven't tried that

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions