-
Couldn't load subscription status.
- Fork 38.1k
gui: Close console with CTRL+D ala terminal #16515
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Tested it, works great. |
|
Concept ACK and the code looks neat. |
|
I guess this is OS specific. However, concept ACK on working on shortcuts to close windows. |
|
Concept ACK, going to test (though I share with @jonasschnelli a slight preference for Ctrl-W as well for closing any subwindow, due to FF browser tabs, but have no problem with Ctrl-D doing the same here, there's already a PR for that anyhow #15768) |
|
Tested ACK 5813b37 |
|
@jonasschnelli does ctrl+w closes any window? |
|
Correction, it sends EOF to the shell prompt, which then terminates, which can result in the window close. |
|
Sure but this effectively closes a terminal (at least on unix(-like) systems) |
|
Not quite: cat
CTRL+D # cat quits |
|
IIRC someone said that this does not send a EOF to the terminal, it "only" closes the terminal. |
on macOS: yes. (Almost) every window (at least all well behaving apps close a window). #15768 is related and I think we should have one PR adding the "close window shortcut functionality". Since this is OS dependent, the shortcut should probably be defined in However, I think each window should be closeable with a default shortcut (including console, help, preferences, etc.). I could not find, but it could be that Qt provide a such functionality already. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 5813b37, built and tested manually, all tests pass.
The added C-d functionality works only with the GUI console window, and not with the info, network traffic, or peers windows.
On Linux Debian for me C-w closes desktop windows (Gnome) and browser tabs (Firefox), and C-d closes terminal windows.
(though I share with @jonasschnelli a slight preference for Ctrl-W as well for closing any subwindow, due to FF browser tabs, but have no problem with Ctrl-D doing the same here, there's already a PR for that anyhow #15768)
Agree.
|
On my Debian Linux MATE Ctrl-W also closes nearly every window except console windows. |
|
I'd prefer to use Ctrl+W for closing any subwindow (like #15768). And using a special shortcut for closing the "Console" window seems an overkill:
Anyway, if reviewers will decide that the "Console" window needs its own shortcut to be closed, it seems the next patch could be an improvement of usability: --- a/src/qt/rpcconsole.cpp
+++ b/src/qt/rpcconsole.cpp
@@ -802,19 +802,21 @@ void RPCConsole::clear(bool clearHistory)
".secwarning { color: red; }"
"b { color: #006060; } "
).arg(fixedFontInfo.family(), QString("%1pt").arg(consoleFontSize))
);
#ifdef Q_OS_MAC
- QString clsKey = "(⌘)-L";
+ QString clear_key = "⌘L";
+ QString close_key = "⌘D";
#else
- QString clsKey = "Ctrl-L";
+ QString clear_key = "Ctrl+L";
+ QString close_key = "Ctrl+D";
#endif
message(CMD_REPLY, (tr("Welcome to the %1 RPC console.").arg(PACKAGE_NAME) + "<br>" +
- tr("Use up and down arrows to navigate history, and %1 to clear screen.").arg("<b>"+clsKey+"</b>") + "<br>" +
+ tr("Use up and down arrows to navigate history, %1 to clear screen and %2 to close this window.").arg("<b>" + clear_key + "</b>").arg("<b>" + close_key + "</b>") + "<br>" +
tr("Type %1 for an overview of available commands.").arg("<b>help</b>") + "<br>" +
tr("For more information on using this console type %1.").arg("<b>help-console</b>") +
"<br><span class=\"secwarning\"><br>" +
tr("WARNING: Scammers have been active, telling users to type commands here, stealing their wallet contents. Do not use this console without fully understanding the ramifications of a command.") +
"</span>"),
true); |
|
meh |
Originally suggested by @emilengler.