bin: Add no-ansi to remove ANSI escape sequences
Similar to `no-ansi-sgr` but removes all ANSI escape sequence, not just
the SGR ones.
See the previous commit bbf9a1da58 (bin:no-ansi-sgr: Set LC_ALL=C for
`[0-?]` range, 2025-07-30) for an explanation of why LC_ALL has to be
set.
This commit is contained in:
7
.local/bin/no-ansi
Executable file
7
.local/bin/no-ansi
Executable file
@@ -0,0 +1,7 @@
|
||||
#!/bin/sh
|
||||
# SPDX-License-Identifier: MIT
|
||||
# Copyright (c) 2025 Julian Prein
|
||||
#
|
||||
# Remove ANSI escape sequences.
|
||||
|
||||
env LC_ALL=C sed 's/\[[0-?]*[ -/]*[@-z]//g'
|
||||
Reference in New Issue
Block a user