Skip to content

Commit a8720a1

Browse files
committed
qt: ctrl+shift+l shortcut to clear output and command history, only clear input when shift is being held
1 parent 4dd9a04 commit a8720a1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/qt/rpcconsole.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,8 @@ RPCConsole::RPCConsole(interfaces::Node& node, const PlatformStyle *_platformSty
506506
ui->openDebugLogfileButton->setIcon(platformStyle->SingleColorIcon(":/icons/export"));
507507
}
508508
ui->clearButton->setIcon(platformStyle->SingleColorIcon(":/icons/remove"));
509+
//: Secondary shortcut to clear console both output and input history
510+
GUIUtil::AddButtonShortcut(ui->clearButton, tr("Ctrl+Shift+L"));
509511

510512
ui->fontBiggerButton->setIcon(platformStyle->SingleColorIcon(":/icons/fontbigger"));
511513
//: Main shortcut to increase the RPC console font size.
@@ -825,7 +827,8 @@ void RPCConsole::setFontSize(int newSize)
825827

826828
void RPCConsole::clear(bool keep_prompt)
827829
{
828-
history.clear();
830+
if (QApplication::keyboardModifiers() & Qt::ShiftModifier)
831+
history.clear();
829832
ui->messagesWidget->clear();
830833
if (!keep_prompt) ui->lineEdit->clear();
831834
ui->lineEdit->setFocus();

0 commit comments

Comments
 (0)