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

无论有无编辑都要用:q!退出 #25

Open
dongly opened this issue Feb 17, 2022 · 11 comments
Open

无论有无编辑都要用:q!退出 #25

dongly opened this issue Feb 17, 2022 · 11 comments

Comments

@dongly
Copy link

dongly commented Feb 17, 2022

打开一个已存在的文件,未编辑就显示[modified],而打开一个不存在的文件则不会

msh /etc>ls
Directory /etc:
a                   <DIR>
b                   <DIR>
cfg.ini             1424
sys.info            129

  • vi 窗口,编辑已存在文件(命令行 msh /etc>vi sys.info)
boot_time1=0
last_boot_time=2022-02-17 18:28:10

boot_time=2022-02-17 21:22:22
boot_time0=1645093690
boot_time1=0
boot_count=101
~
~
~
~
~
~
~
- sys.info [Modified] 1/7 14%
  • vi 窗口,编辑新文件(命令行 msh /etc>vi new.txt
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
- new.txt 1/1 100%

@mysterywolf
Copy link
Member

这个是正常的啊,你用linux键入vi试一下 也是这样子的

@dongly
Copy link
Author

dongly commented Feb 18, 2022

我试了一下,

  • Ubuntu 20.04.3 LTS , 无编辑时,无提示,退出用:q即可;有编辑时,也无提示,退出须:q!
  • busybox vm https://www.busybox.net/live_bbox/live_bbox.html
    无编辑时,无提示,退出用:q即可;有编辑时,也有提示,退出须:q!
  • 本软件包,无论有无编辑都要用:q!退出

@mysterywolf
Copy link
Member

你可以测试一下最新的官方vi是什么行为,https://github.com/mirror/busybox/blob/master/editors/vi.c
这个软件包是按照官方vi同步的,类似于这种行为问题,我没有办法解决的。因为官方就是这么写的。

@mysterywolf
Copy link
Member

我试了一下 vi软件包可以q直接退出啊

@mysterywolf
Copy link
Member

你确认一下 你是进去之后什么都没动,按q,还是进去之后打了些字然后删了,按q

@dongly
Copy link
Author

dongly commented Feb 18, 2022

https://busybox.net/downloads/binaries/1.35.0-x86_64-linux-musl/busybox 2022-1-17 这个版本测试是无问题的

@dongly
Copy link
Author

dongly commented Feb 18, 2022

打开 VI_ENABLE_UNDO 才出问题

@mysterywolf
Copy link
Member

欢迎提交pr来改善这个问题。

@mysterywolf
Copy link
Member

mysterywolf commented Feb 18, 2022

说实话 这个问题我并不想“修”,我都无法确认上游的代码是不是也有这个问题。我需要对着4000行代码一点点去排查。而且这个反馈意义并不大,最后到头来,发现是上游的问题就白折腾了。

@mysterywolf
Copy link
Member

https://github.com/mirror/busybox/blob/master/editors/vi.c#L1707
这行引发的,高度疑似上游就是这个样子的。

@dongly
Copy link
Author

dongly commented Feb 18, 2022

我也跟踪到这行.但我试了最新版的busybox, 是正常的.不明白.先不理吧

@mysterywolf mysterywolf changed the title 打开一个已存在的文件,未编辑就显示[modified] 无论有无编辑都要用:q!退出 Feb 18, 2022
@dongly dongly closed this as completed Sep 15, 2022
@mysterywolf mysterywolf reopened this Sep 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants