Skip to content
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

Remove racy access to readline #20529

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions examples/chip-tool/commands/interactive/InteractiveCommands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ constexpr const char * kInteractiveModeStopCommand = "quit()";

namespace {

bool gIsCommandRunning = false;

void ClearLine()
{
printf("\r\x1B[0J"); // Move cursor to the beginning of the line and clear from cursor to end of the screen
Expand All @@ -42,11 +40,6 @@ void ENFORCE_FORMAT(3, 0) LoggingCallback(const char * module, uint8_t category,
ClearLine();
chip::Logging::Platform::LogV(module, category, msg, args);
ClearLine();

if (gIsCommandRunning == false)
{
rl_forced_update_display();
}
}
} // namespace

Expand Down Expand Up @@ -110,9 +103,7 @@ bool InteractiveStartCommand::ParseCommand(char * command)
{
if (argsCount == kInteractiveModeArgumentsMaxLength)
{
gIsCommandRunning = true;
ChipLogError(chipTool, "Too many arguments. Ignoring.");
gIsCommandRunning = false;
return true;
}

Expand All @@ -122,9 +113,7 @@ bool InteractiveStartCommand::ParseCommand(char * command)
}

ClearLine();
gIsCommandRunning = true;
mHandler->RunInteractive(argsCount, args);
gIsCommandRunning = false;

// Do not delete arg[0]
while (--argsCount)
Expand Down