From 11f3400e4949191a76ba722c3b417123670462d4 Mon Sep 17 00:00:00 2001 From: Jon Parise Date: Tue, 14 May 2024 06:57:02 -0700 Subject: [PATCH] shell-integration: suppress shellcheck issues --- src/shell-integration/bash/ghostty.bash | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/shell-integration/bash/ghostty.bash b/src/shell-integration/bash/ghostty.bash index 6fe039682..8547a3e12 100644 --- a/src/shell-integration/bash/ghostty.bash +++ b/src/shell-integration/bash/ghostty.bash @@ -83,6 +83,7 @@ _ghostty_last_reported_cwd="" function __ghostty_get_current_command() { builtin local last_cmd + # shellcheck disable=SC1007 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 @@ -109,6 +110,7 @@ function __ghostty_precmd() { # Sudo if [[ "$GHOSTTY_SHELL_INTEGRATION_NO_SUDO" != "1" ]] && [[ -n "$TERMINFO" ]]; then # Wrap `sudo` command to ensure Ghostty terminfo is preserved + # shellcheck disable=SC2317 sudo() { builtin local sudo_has_sudoedit_flags="no" for arg in "$@"; do @@ -131,7 +133,8 @@ function __ghostty_precmd() { fi if [[ "$GHOSTTY_SHELL_INTEGRATION_NO_TITLE" != 1 ]]; then - # Command + # Command and working directory + # shellcheck disable=SC2016 PS0=$PS0'$(__ghostty_get_current_command)' PS1=$PS1'\[\e]2;$PWD\a\]' fi