asciimoo / wuzz

Interactive cli tool for HTTP inspection
GNU Affero General Public License v3.0
10.56k stars 412 forks source link

Mac vim excess characters bug fix #138

Open lewesche opened 3 years ago

lewesche commented 3 years ago

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.