Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@lewesche
Copy link

Potential fix for issue #137 with random chars from vim on mac, helpful failure for -c without a file, added CTRL+O to README

I saw the same error on a similar Mac. I experimented a bit and I don't think this is related to the gocui library. Seems to have something to do with .vimrc settings causing vim to spit out weird data into stdout after shutdown:
https://stackoverflow.com/questions/51129631/vim-8-1-garbage-printing-on-screen

Tough to ensure users have a good .vimrc, but one solution is to just not use the .vimrc if the editor is set to vim on a mac:

var cmd *exec.Cmd if editor == "vim" && runtime.GOOS == MAC_OS { cmd = exec.Command(editor, "-u", "NONE", file.Name()) } else { cmd = exec.Command(editor, file.Name()) }

Not ideal but works. I also added a helpful failure message for running the -c flag and no file, rather than a seg fault.

@lewesche lewesche changed the title Mac vim excess characters bug fix #137 Mac vim excess characters bug fix Mar 22, 2021
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

Successfully merging this pull request may close these issues.

1 participant