From 30146007d377cbae94bde7fa6ca85dd2688e1930 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 27 Feb 2022 10:23:04 +0530 Subject: [PATCH] Avoid extra tr invocation --- shell-integration/bash/kitty.bash | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shell-integration/bash/kitty.bash b/shell-integration/bash/kitty.bash index 11e3b5422..4a283716a 100644 --- a/shell-integration/bash/kitty.bash +++ b/shell-integration/bash/kitty.bash @@ -139,8 +139,8 @@ _ksi_main() { last_cmd=$(HISTTIMEFORMAT= builtin history 1) last_cmd="${last_cmd#*[[:digit:]]*[[:space:]]}" # remove leading history number last_cmd="${last_cmd#"${last_cmd%%[![:space:]]*}"}" # remove remaining leading whitespace - last_cmd=$(printf "%s" "$last_cmd" | base64 | tr -d \\n) - builtin printf "\e]22222;%s\a" "${last_cmd}" + last_cmd=$(printf "%s" "$last_cmd" | base64) + builtin printf "\e]22222;%s\a" "${last_cmd//[[:space:]]}" } _ksi_prompt[ps0_suffix]+='$(_ksi_get_current_command)' fi