diff --git a/src/plugins/terminal/terminalcommands.cpp b/src/plugins/terminal/terminalcommands.cpp index 2bfb9ce5199..2bd14090286 100644 --- a/src/plugins/terminal/terminalcommands.cpp +++ b/src/plugins/terminal/terminalcommands.cpp @@ -153,4 +153,13 @@ QAction *TerminalCommands::openSettingsAction() return ActionManager::command("Preferences.Terminal.General")->action(); } +void TerminalCommands::registerOpenCloseTerminalPaneCommand() +{ + Command* terminalCmd = ActionManager::command("QtCreator.Pane.Terminal"); + QTC_ASSERT(terminalCmd, return); + + if (!m_commands.contains(terminalCmd)) + m_commands.append(terminalCmd); +} + } // namespace Terminal diff --git a/src/plugins/terminal/terminalcommands.h b/src/plugins/terminal/terminalcommands.h index 613d0d98229..59f9add643e 100644 --- a/src/plugins/terminal/terminalcommands.h +++ b/src/plugins/terminal/terminalcommands.h @@ -51,6 +51,8 @@ public: static QAction *openSettingsAction(); + void registerOpenCloseTerminalPaneCommand(); + protected: void initWidgetActions(const Core::Context &context); void initPaneActions(const Core::Context &context); diff --git a/src/plugins/terminal/terminalpane.cpp b/src/plugins/terminal/terminalpane.cpp index e796bb98229..94a93ed84e4 100644 --- a/src/plugins/terminal/terminalpane.cpp +++ b/src/plugins/terminal/terminalpane.cpp @@ -295,6 +295,8 @@ void TerminalPane::setFocus() { if (const auto t = currentTerminal()) t->setFocus(); + + TerminalCommands::instance().registerOpenCloseTerminalPaneCommand(); } bool TerminalPane::hasFocus() const