diff --git a/src/debugger/DebuggerParser.cxx b/src/debugger/DebuggerParser.cxx index 698105ac2..1a29f53fe 100644 --- a/src/debugger/DebuggerParser.cxx +++ b/src/debugger/DebuggerParser.cxx @@ -1177,9 +1177,16 @@ void DebuggerParser::executeExec() << uInt32(TimerManager::getTicks()/1000); execPrefix = prefix.str(); } + + // make sure the commands are added to prompt history + StringList history; + ++execDepth; - commandResult << exec(node); + commandResult << exec(node, &history); --execDepth; + + for(const auto& item : history) + debugger.prompt().addToHistory(item.c_str()); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/debugger/gui/PromptWidget.cxx b/src/debugger/gui/PromptWidget.cxx index 1af8decc3..d16f2afe3 100644 --- a/src/debugger/gui/PromptWidget.cxx +++ b/src/debugger/gui/PromptWidget.cxx @@ -784,7 +784,6 @@ void PromptWidget::nextLine() updateScrollBuffer(); } - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // Call this (at least) when the current line changes or when a new line is added void PromptWidget::updateScrollBuffer() diff --git a/src/debugger/gui/PromptWidget.hxx b/src/debugger/gui/PromptWidget.hxx index 9a1f06c2d..0f2d708f3 100644 --- a/src/debugger/gui/PromptWidget.hxx +++ b/src/debugger/gui/PromptWidget.hxx @@ -51,6 +51,8 @@ class PromptWidget : public Widget, public CommandSender // Clear screen and erase all history void clearScreen(); + void addToHistory(const char *str); + protected: int& buffer(int idx) { return _buffer[idx % kBufferSize]; } @@ -75,7 +77,6 @@ class PromptWidget : public Widget, public CommandSender void textPaste(); // History - void addToHistory(const char *str); void historyScroll(int direction); void handleMouseDown(int x, int y, MouseButton b, int clickCount) override;