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
Zero width control characters insert spaces with shell ex commands #4338
Comments
TODO: - [ ] tests - [ ] handle tab chars "\t" neovim#2958 - [ ] handle bell chars "\x07" neovim#4338 If a binary or other output is read from :! the screen should not be affected by accidental (or intentional) control chars. Legacy Vim ":!" gets scrubbed (possibly by canonical ("cooked") mode in mch_call_shell(), see settmode(TMODE_COOK)). Expected behavior: :!echo -en '\x08'|cat - " empty (except "Press ENTER") :!echo -en '\x08' " empty (except "Press ENTER") :!echo -en '\n' " extra line :echo system('echo -en ''\x08\n''') " ^H Issue neovim#4338 :!echo -en '\x07\x07\x07\x07text' " 'text' (not ' text') Issue neovim#2958 (Vim tputs()?) :!echo -e "1\t2\t3" " '1 2 3' Closes neovim#4142 Closes neovim#2958 Closes neovim#4338
TODO: - [ ] tests - [ ] handle tab chars "\t" neovim#2958 - [ ] handle bell chars "\x07" neovim#4338 If a binary or other output is read from :! the screen should not be affected by accidental (or intentional) control chars. Legacy Vim ":!" gets scrubbed (possibly by canonical ("cooked") mode in mch_call_shell(), see settmode(TMODE_COOK)). Expected behavior: :!echo -en '\x08'|cat - " empty (except "Press ENTER") :!echo -en '\x08' " empty (except "Press ENTER") :!echo -en '\n' " extra line :echo system('echo -en ''\x08\n''') " ^H Issue neovim#4338 :!echo -en '\x07\x07\x07\x07text' " 'text' (not ' text') Issue neovim#2958 (Vim tputs()?) :!echo -e "1\t2\t3" " '1 2 3' Closes neovim#4142 Closes neovim#2958 Closes neovim#4338
#7844 outputs bell chars as
This is a design decision. |
closes neovim#5442 closes neovim#4142 ref neovim#6618 ref neovim#4376 ref neovim#7844 ref neovim#2958 ref neovim#4338
closes neovim#5442 closes neovim#4142 ref neovim#6618 ref neovim#4376 ref neovim#7844 ref neovim#2958 ref neovim#4338
closes neovim#5442 closes neovim#4142 ref neovim#6618 ref neovim#4376 ref neovim#7844 ref neovim#2958 ref neovim#4338
The only design decision in #7488 is that we actually can determine what happens on each control char. We could easily change it emit bell, just add it to the list of bytes sent directly to msg_putc (just as ^M was changed) |
Would that work for other control codes like colors? Currently colors are rendered as
|
It is a question of effort. Supporting bell is a trivial one-line change (message.c already supports it, we just need to ask it), so we could just as well do it now, while colors requires implementing or integrating a ANSI control code parser. And the such parser we should (eventually) integrate is |
Discovered while researching #4142 and #2958
Running a shell command that echoes multiple bell symbols followed by text shifts text to the right.
Actual behaviour
Text preceded by zero width control bell character is shifted to the right.
Expected behaviour
Text should start in the first column.
Steps to reproduce
vim 7.4.769 with same configuration exhibits expected behavior
The text was updated successfully, but these errors were encountered: