ConEmu/cygwin newlines don't perform carriage return functionality

别等时光非礼了梦想. 提交于 2020-12-12 06:18:08

问题


I upgraded Cygwin and now Bash is acting weird. Newlines aren't always returning the cursor to the left side of the screen, but sometimes they do. Here is what I'm experiencing:

$ echo hello
            hello
                 Thu Jan 30 08:31:33 :~
$ python3
         Python 3.6.9 (default, Jul 21 2019, 14:33:59)
[GCC 7.4.0] on cygwin
Type "help", "copyright", "credits" or "license" for more information.
>>> 56+23
         79
           >>> 2+3
                  5
                   >>> exit()
                             Thu Jan 30 08:31:46 :~
$

I have TERM=xterm-color, and I've tried TERM=cygwin and just TERM= with no difference in behavior.

Another strange thing is that the less command will mess up the newlines when I first open a file, or page down with Ctrl-F, but if I page up or scroll up or down one line at a time, the formatting is fine.

ls -l works fine. cat works fine.


回答1:


I've determined it's ConEmu. It has something to do with my task command:

C:\cygwin64\bin\bash.exe --login -new_console:P:"<Standard VGA>"

I use this so the background is black. Also, when I logout, the tab closes instead of remaining open.

The default command doesn't have the newline problem, but has the problems stated above:

set CHERE_INVOKING=1 & set "PATH=%ConEmuDrive%\cygwin64\bin;%PATH%" & %ConEmuBaseDirShort%\conemu-cyg-64.exe -new_console:p %ConEmuDrive%\cygwin64\bin\bash.exe --login -i -new_console:C:"%ConEmuDrive%\cygwin64\Cygwin.ico"

Edit: Of course, it has nothing to do with the -new_console:P:"<Standard VGA>" and everything to do with running bash with %ConEmuBaseDirShort%\conemu-cyg-64.exe. I don't know what it does exactly - I need to look into it further.

Edit #2: It turns out there's an issue with arrow and delete keys being disabled by conemu-cyg-64.exe: https://github.com/Maximus5/ConEmu/issues/2035.

Edit #3: Downloading the latest developer snapshot (which is 2020-01-31 at this time) of Cygwin at https://cygwin.com/snapshots/ fixed the problem with the arrow and delete keys for me.

$ unxz cygwin1-20200131.dll.xz
$ mv cygwin1-20200131.dll /bin/cygwin1.dll

Of course, that isn't going to work while Cygwin is running, but you get the idea.




回答2:


Latest Cygwin release fixes this.



来源:https://stackoverflow.com/questions/59987259/conemu-cygwin-newlines-dont-perform-carriage-return-functionality

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!