8000 Fix: Show send(cmd, true) on screen despite profile setting by mpconley · Pull Request #7881 · Mudlet/Mudlet · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix: Show send(cmd, true) on screen despite profile setting #7881

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

Open
wants to merge 8 commits into
base: development
Choose a base branch
from
8 changes: 5 additions & 3 deletions src/Host.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1240,12 +1240,13 @@ QPair<QString, QString> Host::getSearchEngine()
// cTelnet::sendData(...) call:
void Host::send(QString cmd, bool wantPrint, bool dontExpandAliases)
{
if (wantPrint && (!mIsRemoteEchoingActive) && mPrintCommand) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👎 The "profile" setting is entirely contained within this use of mPrintCommand - so removing it here renders everything else about the setting as dead cruft in several files.

Perhaps, the default setting of mPrintCommand to true - currently in the Host constructor initialisation list but really should be moved to the header file - should be amended to false instead - would this address the discomfort you have with this setting @mpconley?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The other place this is used is TCommandLine::enterCommand(QKeyEvent* event) for MiniConsole.

Showing what text is sent is my preferred default option for a profile, as-is. This is a nuance for sure.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, you are right, my searching was flawed and didn't give me that second usage. I suppose there is an option to turn the control in the preferences into a tri-state - with the default being partially checked meaning - "go with the Lua arguments" and the other two being always/never show the send command.

🤷

if (wantPrint && !mIsRemoteEchoingActive) {
if (!cmd.isEmpty() || !mUSE_IRE_DRIVER_BUGFIX || mUSE_FORCE_LF_AFTER_PROMPT) {
// used to print the terminal <LF> that terminates a telnet command
// this is important to get the cursor position right
mpConsole->printCommand(cmd);
}

//If 3D Mapper is active mpConsole->update(); seems to be superfluous and even cause problems in MacOS
#if defined(INCLUDE_3DMAPPER)
if (!mpMap->mpMapper || !mpMap->mpMapper->glWidget) {
Expand All @@ -1255,16 +1256,17 @@ void Host::send(QString cmd, bool wantPrint, bool dontExpandAliases)
mpConsole->update();
}
}

QStringList commandList;

if (!mCommandSeparator.isEmpty()) {
commandList = cmd.split(QString(mCommandSeparator), Qt::SkipEmptyParts);
} else if (!cmd.isEmpty()) {
// don't split command if the command separator is blank
commandList << cmd;
}

// allow sending blank commands

// allow sending blank commands
if (commandList.empty()) {
QString payload(QChar::LineFeed);
mTelnet.sendData(payload);
Expand Down
Loading
0