Both of you were incorrect that an empty string was added to the
command window, which is why I couldn’t reproduce it. After running your
tests (clicking the hyperlink) I immediately pressed Ctrl+H to see the
command history, and there was no extra, blank, command
there, which then mysteriously disappeared later. :)
What was actually happening was that when you click on the output
window, the focus moves to that part of the screen. You will notice that
when you click on the output window the cursor stops flashing in the
command window, because it no longer has the focus.
Certain actions, like ordinary typing, are designed to first put the
focus back into the command window, which is why you probably don’t
usually notice this.
See here for example:
/* If AllTypingToCommandWindow is enabled we redirect character messages to
* the bottom view. */
void CMUSHView::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags)
{
if (App.m_bAllTypingToCommandWindow) {
OnKeysActivatecommandview();
m_bottomview->SendMessage(WM_CHAR, nChar, nRepCnt | (nFlags << 16));
} else
CView::OnChar(nChar, nRepCnt, nFlags);
}
However the command window expects a special message
(ID_KEYS_PREVCOMMAND, not WM_CHAR) in order to call the function which
recalls the previous command, so that wasn’t acted on.
If you look carefully at your current version, when you press
up-arrow after clicking on the hyperlink, the cursor starts flashing in
the command window, so now pressing up-arrow recalls the previous
command.
I’ve made a modification to force the focus back to the command
window after clicking on a hyperlink (commit
b9e52a1) which is available now from the pre-release page, see here.
This has been an interesting example of the X-Y Problem - both of you
confidently reported that an extra entry was being inserted into the
command window, something I couldn’t reproduce because I immediately
pressed Ctrl+H to view the command window.
What the problem really was: After clicking on a hyperlink,
pressing up-arrow to recall the previous command does not work. Or
if you were really observant: After clicking on a hyperlink the
focus does not return to the command window.