From b8de0983f0891175bf030a636ee08b10dfaf8438 Mon Sep 17 00:00:00 2001 From: Ricardo Pardini Date: Tue, 13 Feb 2024 15:27:35 +0100 Subject: [PATCH] wsl2: fix: don't pester user for UTF-8 terminal if stdin is not a terminal --- lib/functions/host/wsl2.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/functions/host/wsl2.sh b/lib/functions/host/wsl2.sh index 45d375a251..d35a3a5d68 100644 --- a/lib/functions/host/wsl2.sh +++ b/lib/functions/host/wsl2.sh @@ -26,6 +26,7 @@ function check_windows_wsl2() { } function wsl2_pester_user_for_terminal() { + [[ ! -t 0 ]] && return 0 # return 0 if user is not on a terminal [[ "x${SSH_CLIENT}x" != "xx" ]] && return 0 # not if being accessed over SSH [[ "x${WT_SESSION}x" != "xx" ]] && return 0 # WT_SESSION from Windows Terminal # From info in https://stackoverflow.com/questions/59733731/how-to-detect-if-running-in-the-new-windows-terminal