diff --git a/profile.d/80-systemd-osc-context.sh b/profile.d/80-systemd-osc-context.sh index 60ab9904f1..c83e0d3c42 100644 --- a/profile.d/80-systemd-osc-context.sh +++ b/profile.d/80-systemd-osc-context.sh @@ -13,6 +13,10 @@ # Not bash? [ -n "${BASH_VERSION:-}" ] || return 0 +# If we're on a "dumb" terminal, do not install the prompt. +# Treat missing $TERM same as "dumb". +[ "${TERM:-dumb}" = "dumb" ] && return 0 + __systemd_osc_context_escape() { # Escape according to the OSC 3008 spec. Since this requires shelling out # to 'sed' we'll only do it where it's strictly necessary, and skip it when @@ -56,7 +60,7 @@ __systemd_osc_context_precmdline() { read -r systemd_osc_context_cmd_id /dev/null)" ] || PROMPT_COMMAND+=('')