这玩意有其他IDE没,这类第三方模块,估计没人能开展适配,只是操作上会多一个Q?会不会是设置问题? 如果提示有确实什么依赖包啥的,估计还有戏,这种操作行为应该是没人会去处理吧,可以看看这个情况是否可以通过设置来解决,或是有啥其他解决方案,其他发行版上,主要是哪些发行版,使用的版本都一样么?
测试了AnolisOS7和Debian11,确实没有这个问题,经过与Deepin的对比,发现在ncl中使用print()输出内容时,按h唤出帮助界面可以看到,它与linux常用命令more的帮助界面是一致的。于是使用more命令查看超出终端显示范围的文本文件,对比三个系统的表现可以看出:当查看至文件内容的最后一行时,Debian11和AnolisOS7按Enter(向下n行,默认1行)可以直接退出more界面并返回到终端,而Deepin则会显示(END),要求按Q退出。(注:more命令中Enter可以查看下一行,并没有明确说明有退出的作用,退出要求按Q或Ctrl+C)
more -V
查看版本,可以看到:它是在util-linux包中的,各版本如下:
AnolisOS7 util-linux 2.32.2
Debian11 util-linux 2.36.1
DeepinV20 util-linux 2.38.1
其中Deepin使用的util-linux版本较其他两个版本更新,或许util-linux的维护团队认为在最后一行Enter可以退出more界面是个BUG,然后修复了它?(这只是我的一点猜测,并没有去考证)
在DeepinV20仓库中,可以找到util-linux较旧的版本2.33.1,你可以试着安装这个版本的util-linux以解决此问题。(亲测有效)
sudo apt install util-linux=2.33.1-0.1
补充:
(注:Debian12使用的util-linux版本与DeepinV20一样是2.38.1,也会出现贴主遇到的问题)
补充:
util-linux v2.38-ReleaseNotes中,关于more指令的修改
more:
- Calling open without checking return value [coverity scan] [Karel Zak]
- POSIX compliance patch preventing exit on EOF without -e [Ian Jones]
- add __format__ attribute [Karel Zak]
- clear SIGCHLD inherited setting [Karel Zak]
- fix -e in non-interactive mode [Karel Zak]
- fix null-pointer dereference [Karel Zak]
- fix setuid/setgid order [Karel Zak]
- improve zero size handling [Tobias Stoeckmann]
- use snprintf() rather than sprintf() [Karel Zak]
其中第二条:POSIX compliance patch preventing exit on EOF without -e [Ian Jones]
修复了在不使用-e参数的情况下到文件末尾时可以异常退出文件的问题。
这玩意有其他IDE没,这类第三方模块,估计没人能开展适配,只是操作上会多一个Q?会不会是设置问题? 如果提示有确实什么依赖包啥的,估计还有戏,这种操作行为应该是没人会去处理吧,可以看看这个情况是否可以通过设置来解决,或是有啥其他解决方案,其他发行版上,主要是哪些发行版,使用的版本都一样么?
应该是和more命令的版本有关,相较其他版本的Linux如AnolisOS7、Debian11,DeepinV20使用了较新版本的util-linux,这个版本中,使用more查看超过终端显示范围的多行文本文件时,在查看到最后一行后,再次按Enter会显示(END),必须按照要求按Q或Ctrl+C退出more界面,而不再是按Enter就直接退出了more界面(毕竟Enter的本意是向下n行,默认1行)。
测试了AnolisOS7和Debian11,确实没有这个问题,经过与Deepin的对比,发现在ncl中使用print()输出内容时,按h唤出帮助界面可以看到,它与linux常用命令more的帮助界面是一致的。于是使用more命令查看超出终端显示范围的文本文件,对比三个系统的表现可以看出:当查看至文件内容的最后一行时,Debian11和AnolisOS7按Enter(向下n行,默认1行)可以直接退出more界面并返回到终端,而Deepin则会显示(END),要求按Q退出。(注:more命令中Enter可以查看下一行,并没有明确说明有退出的作用,退出要求按Q或Ctrl+C)
more -V
查看版本,可以看到:它是在util-linux包中的,各版本如下:
AnolisOS7 util-linux 2.32.2
Debian11 util-linux 2.36.1
DeepinV20 util-linux 2.38.1
其中Deepin使用的util-linux版本较其他两个版本更新,或许util-linux的维护团队认为在最后一行Enter可以退出more界面是个BUG,然后修复了它?(这只是我的一点猜测,并没有去考证)
在DeepinV20仓库中,可以找到util-linux较旧的版本2.33.1,你可以试着安装这个版本的util-linux以解决此问题。(亲测有效)
sudo apt install util-linux=2.33.1-0.1
补充:
(注:Debian12使用的util-linux版本与DeepinV20一样是2.38.1,也会出现贴主遇到的问题)
补充:
util-linux v2.38-ReleaseNotes中,关于more指令的修改
more:
- Calling open without checking return value [coverity scan] [Karel Zak]
- POSIX compliance patch preventing exit on EOF without -e [Ian Jones]
- add __format__ attribute [Karel Zak]
- clear SIGCHLD inherited setting [Karel Zak]
- fix -e in non-interactive mode [Karel Zak]
- fix null-pointer dereference [Karel Zak]
- fix setuid/setgid order [Karel Zak]
- improve zero size handling [Tobias Stoeckmann]
- use snprintf() rather than sprintf() [Karel Zak]
其中第二条:POSIX compliance patch preventing exit on EOF without -e [Ian Jones]
修复了在不使用-e参数的情况下到文件末尾时可以异常退出文件的问题。
嗯,应该是版本不同,带来的特性吧
嗯,应该是版本不同,带来的特性吧
是的,util-linux v2.38修复了不使用-e参数的情况下仍然可以在文件末尾退出的BUG
more:
- POSIX compliance patch preventing exit on EOF without -e [Ian Jones]
是的,util-linux v2.38修复了不使用-e参数的情况下仍然可以在文件末尾退出的BUG
more:
- POSIX compliance patch preventing exit on EOF without -e [Ian Jones]
艾特楼主看一下哈,@刘
感谢您们的努力!您的测试的速度真是令人惊叹,最后我尝试着解决了这个问题,我是用了如下语句:
vi ~/.bashrc
export PAGER="cat"
看起来就是新版本默认使用 ‘linux more‘ 命令的原因。在debian12中同样可以解决这个问题
Popular Events
More
我在NCL进行print("Hello World")操作时,总是会出现一个需要按q才能退出的输出模式,其他Linux发行版都没有这个bug,由于NCL只能用linux,希望能修复这个bug,deepin真的优化的很好,感谢!
按q之后