MCPcopy Create free account
hub / github.com/ConEmu/ConEmu / GetFirstCommandForPrompt

Method GetFirstCommandForPrompt

src/ConEmu/SetCmdTask.cpp:442–467  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

440}
441
442CEStr CommandTasks::GetFirstCommandForPrompt() const
443{
444 CEStr lsData;
445 LPCWSTR pszTemp = this->pszCommands;
446 if ((pszTemp = NextLine(pszTemp, lsData)))
447 {
448 RConStartArgsEx args;
449 const auto* const pszRaw = gpConEmu->ParseScriptLineOptions(lsData.ms_Val, nullptr, nullptr);
450 if (pszRaw)
451 {
452 args.pszSpecialCmd = lstrdup(pszRaw).Detach();
453 // Parse all -new_console's
454 args.ProcessNewConArg();
455 // Prohibit external requests for credentials
456 args.CleanPermissions();
457 // Directory?
458 if (!args.pszStartupDir && this->pszGuiArgs)
459 {
460 this->ParseGuiArgs(&args);
461 }
462 // Prepare for execution
463 lsData = args.CreateCommandLine(false);
464 }
465 }
466 return lsData;
467}

Callers 2

GuiServerCommandMethod · 0.80
cmdGetTaskCmdMethod · 0.80

Calls 8

ParseGuiArgsMethod · 0.95
NextLineFunction · 0.85
lstrdupFunction · 0.85
ProcessNewConArgMethod · 0.80
CleanPermissionsMethod · 0.80
DetachMethod · 0.45
CreateCommandLineMethod · 0.45

Tested by

no test coverage detected