From ef3cd302bd80cf4ad99b678dd18585e13c231dd9 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Tue, 15 Apr 2025 10:09:03 +0200 Subject: [PATCH] ProjectExplorer: Do no start ssh in a new session on macOS Fixes: QTCREATORBUG-32613 Change-Id: If131af9f6f1b87ec65ceb61882c20265bdb55504 Reviewed-by: Jarek Kobus Reviewed-by: Marcus Tillmanns --- .../projectexplorer/devicesupport/sshparameters.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/plugins/projectexplorer/devicesupport/sshparameters.cpp b/src/plugins/projectexplorer/devicesupport/sshparameters.cpp index f8e25422ae3..55fc0745958 100644 --- a/src/plugins/projectexplorer/devicesupport/sshparameters.cpp +++ b/src/plugins/projectexplorer/devicesupport/sshparameters.cpp @@ -93,8 +93,14 @@ void SshParameters::setupSshEnvironment(Process *process) } process->setEnvironment(env); - // Otherwise, ssh will ignore SSH_ASKPASS and read from /dev/tty directly. - process->setDisableUnixTerminal(); + // Originally, OpenSSH used to ignore the value of SSH_ASKPASS if it had access to a terminal, + // reading instead from /dev/tty directly. + // Therefore, we needed to start the ssh process in a new session. + // Since version 8.4, we can (and do) force the use of SSH_ASKPASS via the SSH_ASKPASS_REQUIRE + // environment variable. We still create a new session for backward compatibility, but not + // on macOS, because of QTCREATORBUG-32613. + if (!HostOsInfo::isMacHost()) + process->setDisableUnixTerminal(); } bool operator==(const SshParameters &p1, const SshParameters &p2)