Skip to content

Commit

Permalink
imp - Render the preset instead of writing it manually
Browse files Browse the repository at this point in the history
---

This is served as a workaround to a Terminaux bug.

---

Type: imp
Breaking: False
Doc Required: False
Part: 1/1
  • Loading branch information
AptiviCEO committed Feb 9, 2024
1 parent 9289385 commit 926f642
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions public/Nitrocid/Shell/ShellBase/Shells/ShellManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -333,13 +333,15 @@ public static void GetLine(string FullCommand, string OutputPath = "", string Sh
// We need to put a synclock in the below steps, because the cancellation handlers seem to be taking their time to try to suppress the
// thread abort error messages. If the shell tried to write to the console while these handlers were still working, the command prompt
// would either be incomplete or not printed to the console at all.
string prompt = "";
lock (CancellationHandlers.GetCancelSyncLock(ShellType))
{
// Print a prompt
var preset = PromptPresetManager.GetCurrentPresetBaseFromShell(ShellType);
if (!string.IsNullOrEmpty(FullCommand))
PromptPresetManager.WriteShellCompletionPrompt(ShellType);
prompt = preset.PresetPromptCompletion;
else
PromptPresetManager.WriteShellPrompt(ShellType);
prompt = preset.PresetPrompt;
}

// Raise shell initialization event
Expand All @@ -349,8 +351,8 @@ public static void GetLine(string FullCommand, string OutputPath = "", string Sh
DebugWriter.WriteDebug(DebugLevel.I, "Waiting for command");
string strcommand =
shellInfo.OneLineWrap ?
InputTools.ReadLineWrapped("", "", settings) :
InputTools.ReadLine("", "", settings);
InputTools.ReadLineWrapped(prompt, "", settings) :
InputTools.ReadLine(prompt, "", settings);
DebugWriter.WriteDebug(DebugLevel.I, "Waited for command [{0}]", strcommand);
if (strcommand == ";")
strcommand = "";
Expand Down

0 comments on commit 926f642

Please sign in to comment.