Terminal: Show key when input is hidden

Change-Id: I5fca6a8c4f43ea2b95bad4df247b5df0abad521c
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This commit is contained in:
Marcus Tillmanns
2023-06-15 14:16:53 +02:00
parent c32b7067fe
commit e17866e283
11 changed files with 115 additions and 7 deletions

View File

@@ -126,7 +126,12 @@ void TerminalWidget::setupPty()
env.unset("CLINK_NOAUTORUN");
m_process->setProcessMode(ProcessMode::Writer);
m_process->setPtyData(Utils::Pty::Data());
Utils::Pty::Data data;
data.setPtyInputFlagsChangedHandler([this](Pty::PtyInputFlag flags) {
const bool password = (flags & Pty::InputModeHidden);
setPasswordMode(password);
});
m_process->setPtyData(data);
m_process->setCommand(shellCommand);
if (m_openParameters.workingDirectory.has_value())
m_process->setWorkingDirectory(*m_openParameters.workingDirectory);