forked from qt-creator/qt-creator
Terminal: use shell name as terminal tab name
This way cmd, bash, powershell are more descriptive than "Terminal" Change-Id: I19310f423cd4188ecc48580a30ed414833a15aee Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This commit is contained in:
@@ -162,6 +162,10 @@ void TerminalWidget::setupPty()
|
||||
});
|
||||
|
||||
connect(m_process.get(), &QtcProcess::started, this, [this] {
|
||||
m_shellName = m_process->commandLine().executable().fileName();
|
||||
if (HostOsInfo::isWindowsHost() && m_shellName.endsWith(QTC_WIN_EXE_SUFFIX))
|
||||
m_shellName.chop(QStringLiteral(QTC_WIN_EXE_SUFFIX).size());
|
||||
|
||||
applySizeChange();
|
||||
emit started(m_process->processId());
|
||||
});
|
||||
@@ -463,6 +467,11 @@ void TerminalWidget::setSelection(const std::optional<Selection> &selection)
|
||||
m_selection = selection;
|
||||
}
|
||||
|
||||
QString TerminalWidget::shellName() const
|
||||
{
|
||||
return m_shellName;
|
||||
}
|
||||
|
||||
const VTermScreenCell *TerminalWidget::fetchCell(int x, int y) const
|
||||
{
|
||||
QTC_ASSERT(y >= 0, return nullptr);
|
||||
|
||||
Reference in New Issue
Block a user