minor script changes
This commit is contained in:
parent
68b761a883
commit
8b5141f8bf
3 changed files with 16 additions and 6 deletions
10
.local/bin/escapefilter
Executable file
10
.local/bin/escapefilter
Executable file
|
@ -0,0 +1,10 @@
|
|||
#!/usr/bin/env perl
|
||||
# this script should filter out any terminal escapes in a text stream
|
||||
while (<>) {
|
||||
s/ \e[ #%()*+\-.\/]. |
|
||||
\e\[ [ -?]* [@-~] | # CSI ... Cmd
|
||||
\e\] .*? (?:\e\\|[\a\x9c]) | # OSC ... (ST|BEL)
|
||||
\e[P^_] .*? (?:\e\\|\x9c) | # (DCS|PM|APC) ... ST
|
||||
\e. //xg;
|
||||
print;
|
||||
}
|
|
@ -2,9 +2,10 @@
|
|||
set -e
|
||||
|
||||
if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ]; then
|
||||
command lf "$@"
|
||||
# shellcheck disable=2068
|
||||
command lf $@
|
||||
else
|
||||
[ ! -d "$HOME/.cache/lf" ] && mkdir --parents "$HOME/.cache/lf"
|
||||
# shellcheck disable=2016
|
||||
command lf -command 'set_previewer sixel' "$@" 3>&-
|
||||
# shellcheck disable=2016,2068
|
||||
command lf -command 'set_previewer sixel' $@ 3>&-
|
||||
fi
|
||||
|
|
|
@ -37,10 +37,9 @@ sub trashed_files ( $search_path, $trash_path ) {
|
|||
|
||||
sub fzf_files (@files) {
|
||||
my $n = 0;
|
||||
my $str;
|
||||
my $str = "";
|
||||
for my $e (@files) {
|
||||
$str .= "\n" if $n > 0;
|
||||
$str .= "$n | $$e[2] | $$e[1]";
|
||||
$str = "$n | $$e[2] | $$e[1]\n" . $str;
|
||||
$n++;
|
||||
}
|
||||
chomp($str);
|
||||
|
|
Loading…
Add table
Reference in a new issue