conemu using cygwin does not seem to recognise '\r' as a line end - specifically for git command reflog (and a few others)

3

When I run the git command git reflog via conemu using cygwin on windows 7 I get the entire output on one line.

I figured it was some line ending issue that conemu is not picking up.

So I tried the following command:

git reflog | tr '\r' '\n'

(Which replaces '\r' with '\n') - then I get the result that I want (each log on a separate line).

I am not sure if it is conemu of Cygwin that is not recognising the '\r' as a new line, but does anyone know how to fix that?

code_fodder

Posted 2017-02-22T13:12:34.010

Reputation: 1 057

\r does not mean "new line", it means "put the cursor at the beginning of the current line". – Maximus – 2017-02-22T13:36:55.827

@Maximus I know, that is like saying '\n' does not mean new line it means "line feed" and do not go back to the start of the line.... This does not address or help my problem : ( It appears that the git reflog command has \r at the end of each line (instead of \n or \r\n). I would like conemu/Cygwin to interpret that as a new line. – code_fodder – 2017-02-22T14:03:07.207

\r is often used during continuous progress output to update the same line. Anyway, it's a question to your for version, why the only command is using wrong cr/lf seq. And I have not observed such bad behavior on my machines. – Maximus – 2017-02-22T17:54:32.260

@maximus in this case it is not used as a continuous progression. If you know git at all - it's basically like the 'git log' it should produce a list - not a progression (not like a counting percentage). So my question maybe a version issue - I don't know and I don't really know how to debug it / find out why ... So this is why I am asking the question : ) – code_fodder – 2017-02-22T18:58:55.423

The git is not the only console application available in the world. "Fixing" the git's configuration bug by changing CR behavior to wrong one would break tons of other applications. – Maximus – 2017-02-23T07:46:59.747

I know this, but still I would like to get it working. The same command under DOS works fine (for example)... maybe the fix can be applied to git.... I don't know, this is why I ask the question, maybe someone has a clue? – code_fodder – 2017-02-23T08:38:58.677

I suppose asking the question on the git-for-windows issue tracker would have better effect. – Maximus – 2017-02-25T15:15:30.817

@Maximus ....lol.... sure, if its a git issue. Again, I don't know - hence the question. – code_fodder – 2017-02-27T07:49:44.267

I am facing the same issue - \r not does nothing (expect - put cursor at the beginning of the line) on output of ALL programms (not just git). I use current cygwin version and Conemu. If I start the same environment (bash shell) from cygwin terminal, \r works. Could you please advice, @Maximus? – Anton Golubev – 2020-01-31T22:22:45.613

1Due to lastest reporters the things are totally broken. The problem is somewhere in upstream (cygwin implement if pty), there were breaking changes. I haven't solution yet unfortunately – Maximus – 2020-02-01T10:45:03.660

No answers