Skip to content

Commit

Permalink
Conemu: fix switch of repo folder in console tab
Browse files Browse the repository at this point in the history
ConEmu handling of new line should have changed
(and the cursor is now passing to the next line and no more run the command entered in the prompt)
so now sending the "Enter" key so that the "cd" command is run

Fixes #9761 (comment)

For ConEmu macro keys: https://conemu.github.io/en/GuiMacro.html#Keys
  • Loading branch information
pmiossec committed Jan 16, 2023
1 parent 1ee9b75 commit 7b063ce
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions GitUI/Shells/ConEmuControlExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,17 @@ public static void ChangeFolder(this ConEmuControl? terminal, IShellDescriptor?
switch (shell.Name)
{
case BashShell.ShellName:
// Use a ConEmu macro to send the sequence for clearing the bash command line
terminal.RunningSession.BeginGuiMacro("Keys").WithParam("^A").WithParam("^K").ExecuteSync();
terminal.RunningSession.WriteInputTextAsync(command + Environment.NewLine);
terminal.RunningSession.WriteInputTextAsync(command);
break;

default:
terminal.RunningSession.WriteInputTextAsync($"\x1B{command}{Environment.NewLine}");
terminal.RunningSession.WriteInputTextAsync($"\x1B{command}");
break;
}

terminal.RunningSession.BeginGuiMacro("Keys").WithParam("Enter").ExecuteSync();
}
}
}

0 comments on commit 7b063ce

Please sign in to comment.