Skip to content

Conversation

@waketraindev
Copy link
Contributor

Prefix filtered commands with "#" before adding them to the RPC console history.

Console lines starting with "#" are ignored by the executor, preventing accidental re-execution of filtered sensitive commands when recalled from history.

Also adds a noop signal to handle ignored commands cleanly and documents comment behavior in the console help text (help-console).

@DrahtBot
Copy link
Contributor

DrahtBot commented Nov 6, 2025

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Reviews

See the guideline for information on the review process.
A summary of reviews will appear here.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #910 (Added test coverage for qt gui#901 console history filter by waketraindev)
  • #882 (Add console commands for clearing output and history by waketraindev)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

@waketraindev waketraindev changed the title qt: Comment out sensitive commands in history to prevent re-execution qt: Comment out sensitive console commands in history to prevent re-execution Nov 6, 2025
@waketraindev waketraindev changed the title qt: Comment out sensitive console commands in history to prevent re-execution Comment out sensitive console commands in history to prevent re-execution Nov 6, 2025
@DrahtBot
Copy link
Contributor

DrahtBot commented Nov 6, 2025

🚧 At least one of the CI tasks failed.
Task Windows native, VS 2022: https://github.com/bitcoin-core/gui/actions/runs/19137200809/job/54692201187
LLM reason (✨ experimental): CTest failed because the test_bitcoin-qt test failed (exit code 8).

Hints

Try to run the tests locally, according to the documentation. However, a CI failure may still
happen due to a number of reasons, for example:

  • Possibly due to a silent merge conflict (the changes in this pull request being
    incompatible with the current code in the target branch). If so, make sure to rebase on the latest
    commit of the target branch.

  • A sanitizer issue, which can only be found by compiling with the sanitizer and running the
    affected test.

  • An intermittent issue.

Leave a comment here, if you need help tracking down a confusing failure.

@waketraindev waketraindev marked this pull request as draft November 6, 2025 17:26
Comment on lines +1107 to +1111
connect(m_executor, &RPCExecutor::noop, this, [this]() {
ui->messagesWidget->undo();
scrollToEnd();
m_is_executing = false;
});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does this need a signal/slot?

"Lines starting with '#' are treated as comments and are not executed.\n"
" example: # Hello world\n\n")));
return;
} else if (executableCommand.starts_with("#")) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should probably check this before parsing (top of RPCConsole::on_lineEdit_returnPressed)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants