forked from qt-creator/qt-creator
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:
@@ -172,6 +172,12 @@ bool UnixPtyProcess::startProcess(const QString &shellPath,
|
||||
static std::array<char, maxRead> buffer;
|
||||
|
||||
int len = ::read(m_shellProcess.m_handleMaster, buffer.data(), buffer.size());
|
||||
|
||||
struct termios termAttributes;
|
||||
tcgetattr(m_shellProcess.m_handleMaster, &termAttributes);
|
||||
const bool isPasswordEntry = !(termAttributes.c_lflag & ECHO) && (termAttributes.c_lflag & ICANON);
|
||||
m_inputFlags.setFlag(PtyInputFlag::InputModeHidden, isPasswordEntry);
|
||||
|
||||
if (len > 0) {
|
||||
m_shellReadBuffer.append(buffer.data(), len);
|
||||
m_shellProcess.emitReadyRead();
|
||||
|
||||
Reference in New Issue
Block a user