I noticed this myself, but forgot to report it as it seemed only minor at the time.
If you paste more than one line from a text editor to the command line, the new lines are stripped and the whole thing ends up as a single line.
It was pointed out to me again just now, by a friend that works as a dev, that he pastes code into the command line a lot and likes to do it more than one line at a time.
Could this be either fixed (or if not a bug, then changed)?
Bug: newlines being stripped when pasted to command line
Re: Bug: newlines being stripped when pasted to command line
Hi, friend that Caled mentioned here.
If this bug is a problem for anyone else, I came up with a temporary fix in the meantime.
In TCommandLine.cpp: void TCommandLine::enterCommand( QKeyEvent * event )
There should be a line at the very top of this routine that looks like:
Comment this out, and either directly above or below it paste in:
If this bug is a problem for anyone else, I came up with a temporary fix in the meantime.
In TCommandLine.cpp: void TCommandLine::enterCommand( QKeyEvent * event )
There should be a line at the very top of this routine that looks like:
Code: Select all
mpHost->send( text() );
Code: Select all
QString cmd = text();
QString delimit("\n");
QStringList cmdlist = cmd.split(delimit);
for (int i = 0; i < cmdlist.size(); i++ ) {
mpHost->send(cmdlist[i]);
}
Re: Bug: newlines being stripped when pasted to command line
This is done intentionally actually; the only bug is that newlines actually get deleted only and not replaced with a space.
For multi-line pastes ("as intended", but usually that's not the common type) mud clients usually either a) provide a separate dialog, or b) provide an button beside the input line to toggle the input mode (multiline or no).
I personally lean towards the button toggle by the input line, as it's a relatively popular option for some and easy access would be worth the space.
For multi-line pastes ("as intended", but usually that's not the common type) mud clients usually either a) provide a separate dialog, or b) provide an button beside the input line to toggle the input mode (multiline or no).
I personally lean towards the button toggle by the input line, as it's a relatively popular option for some and easy access would be worth the space.
Re: Bug: newlines being stripped when pasted to command line
As Vadi has said, the behaviour is indeed intentional, but this doesn't mean that it shouldn't be changed. I think that Micheal is right that we should at least offer a multiline enabled command line for those who need such a feature. I'll look into Michael's patch tonight.Michael wrote:Hi, friend that Caled mentioned here.
If this bug is a problem for anyone else, I came up with a temporary fix in the meantime.
In TCommandLine.cpp: void TCommandLine::enterCommand( QKeyEvent * event )
There should be a line at the very top of this routine that looks like:Comment this out, and either directly above or below it paste in:Code: Select all
mpHost->send( text() );
Code: Select all
QString cmd = text(); QString delimit("\n"); QStringList cmdlist = cmd.split(delimit); for (int i = 0; i < cmdlist.size(); i++ ) { mpHost->send(cmdlist[i]); }
Re: Bug: newlines being stripped when pasted to command line
That's awesome, thanks. (P.S. does this "post needs approval before it's viewable" thing ever go away?)
Edit: Apparently it does!
Edit: Apparently it does!