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

Conemu: fix switch of repo folder in console tab #10613

Merged
merged 1 commit into from Jan 16, 2023

Conversation

pmiossec
Copy link
Member

@pmiossec pmiossec commented Jan 5, 2023

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)
Fixes #10610

For ConEmu macro keys: https://conemu.github.io/en/GuiMacro.html#Keys

Screenshots

Before

console_switch_failed

After

console_switch_succeed

Test methodology

  • Manual with bash and cmd

Test environment(s)

  • Git Extensions 33.33.33
  • Build 88ccf32
  • Git 2.38.0.windows.1 (recommended: 2.38.1 or later)
  • Microsoft Windows NT 10.0.19042.0
  • .NET 6.0.12
  • DPI 96dpi (no scaling)

Merge strategy

I agree that the maintainer squash merge this PR (if the commit message is clear).


✒️ I contribute this code under The Developer Certificate of Origin.

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 gitextensions#9761 (comment)

For ConEmu macro keys: https://conemu.github.io/en/GuiMacro.html#Keys
@ghost ghost assigned pmiossec Jan 5, 2023
@pmiossec pmiossec requested a review from mstv January 5, 2023 22:58
break;

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

Choose a reason for hiding this comment

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

Which term is which?

Copy link
Member Author

Choose a reason for hiding this comment

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

🤔hummm.... I don't get it.

I have remove the new line because it is no more working in ConEmu and replace by sending the Enter key to run the command...

Copy link
Member

Choose a reason for hiding this comment

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

The first case is BashShell.ShellName, no \x1B
Is the macro invoked in both situations, what is the difference?
How to test both paths?

Copy link
Member Author

Choose a reason for hiding this comment

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

The first case if for bash where we use a macro because it doesn't react like other shells (cmd, powershell, pwsh) that clean the command line when you print the Esc ( \x1B ) char.

Is the macro invoked in both situations, what is the difference?

Then the macro to send Enter is used to press ENter in both cases (now that printing new line doesn't work anymore)

How to test both paths?

Switching the default shell
image

Copy link
Member

@mstv mstv left a comment

Choose a reason for hiding this comment

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

Looks sensible, have not run yet

@pmiossec pmiossec merged commit 7b063ce into gitextensions:master Jan 16, 2023
@pmiossec pmiossec deleted the fix_console_repo_switch branch January 16, 2023 10:51
@ghost ghost added this to the vNext milestone Jan 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants