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

cannot use Caret with Git #840

Closed
okoetter opened this issue Feb 15, 2016 · 8 comments
Closed

cannot use Caret with Git #840

okoetter opened this issue Feb 15, 2016 · 8 comments

Comments

@okoetter
Copy link

If I have a git command ending with ^ like git rebase abcdef^ the command is not executed but on the next line I get a "Mehr?", that's German for "More?".

@MartiUK
Copy link
Member

MartiUK commented Feb 15, 2016

Try running it with two carets: ^^

http://www.psteiner.com/2008/12/using-caret-in-windows-batch-files.html

or use Powershell!

@okoetter
Copy link
Author

ok, thanks. But this worked before I updated my older version some days ago... :-)

@kenny-reyes
Copy link

kenny-reyes commented Mar 24, 2021

Closed, really? it still not working it's only a bad workaround. You should to include as a bug

@chrisant996
Copy link
Contributor

chrisant996 commented Mar 25, 2021

This is how CMD works. If it was "working" at some point, then it was probably due to some bug in Clink, which must have been mishandling the input line, and that bug probably got fixed.

You can confirm easily:

  1. Windows+R to show the Run dialog.
  2. Type cmd and press Enter.
  3. Type echo one two^ and press Enter.

CMD is designed to prompt More? when the input ends with ^; it's just how CMD works.

@kenny-reyes
Copy link

kenny-reyes commented Mar 25, 2021

I still think there is some bug. There are some weird behaviors. For example with the whitespace.
problem

Of course, you can type ^ 2 times or even use git checkout HEAD^1 (or HEAD~1). But it doesn't mean there isn't something strange and very possible a bug.

@chrisant996
Copy link
Contributor

chrisant996 commented Mar 25, 2021

Can you clarify specifically which actions in the video you feel illustrate a bug?
Everything looks how I would expect.

Maybe it isn't clear what ^ does.
The ^ is the CMD escape character. It's similar to \ in bash.
Typing git checkout HEAD^ here is the same as git checkout HEAD here.
Typing git checkout HEAD^2 here is the same as git checkout HEAD2 here.
Typing git checkout HEAD^here is the same as git checkout HEADhere.
Typing git checkout HEAD^^ escapes the escape character, so that the command line ends up as git checkout HEAD^.
Typing git checkout HEAD^ ends with an escape character, which is incomplete input -- because it is incomplete input, CMD prompts More? asking for the input to be finished.

Try doing an internet search for "cmd caret character" to find further information about how the caret works in CMD.

@kenny-reyes
Copy link

Sorry, I thought I was clear enough.

if you type caret '^' and ' ' whitespace (spacebar) in notepad, cmd, git bash, power shell, VSCode, etc.... you will have '^' (simple caret).
If you do the same in cmder you will have nothing (not simple caret).

It's possible it is happening only on my machine because It's weird nobody more reported previously, (it's very annoying can't type simple caret). I will install cmder in all my computers to testing that and write again later.

@chrisant996
Copy link
Contributor

Oh! Sorry, I didn't understand that the typing itself is what you were reporting -- i.e. before pressing Enter. The issue in the thread here is about what happens after pressing Enter. So the issue you're encountering sounds unrelated to this issue thread.

My psychic powers tell me you using a keyboard layout where typing ^ a produces â. Am I right? If yes, then you are running into clink #79; Issue with United States - International keyboard layout.

In that case, it was fixed in Clink v1.1.36, which Cmder probably has not picked up yet. You should be able to copy the latest Clink release into Cmder's vendor\clink directory to resolve the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants