Files
dotfiles/.local/bin/no-ansi
Julian Prein 8380d4cc29 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.
2025-08-04 11:00:14 +02:00

8 lines
155 B
Bash
Executable File
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/sh
# SPDX-License-Identifier: MIT
# Copyright (c) 2025 Julian Prein
#
# Remove ANSI escape sequences.
env LC_ALL=C sed 's/\[[0-?]*[ -/]*[@-z]//g'