Closed gregorias closed 3 years ago
It appears that this is a general problem with my Neovim not Ormolu.
Doing :! echo asdf
also result in this error message.
https://github.com/neovim/neovim/issues/6336 was relevant for this problem. I used Fish and a command in my config.fish
was expecting an interactive shell. I found the culprit command and added an if that checks if status is-interactive
before calling the culprit command.
Faced the same issue as @gregorias and the same actions helped
For me it was fish config for powerline that contains some stty
calls
The code before from my fish.config
:
set fish_function_path $fish_function_path "/usr/share/powerline/bindings/fish"
source /usr/share/powerline/bindings/fish/powerline-setup.fish
powerline-setup
The code after:
if status --is-interactive
set fish_function_path $fish_function_path "/usr/share/powerline/bindings/fish"
source /usr/share/powerline/bindings/fish/powerline-setup.fish
powerline-setup
end
Describe the bug When ormolu is called within Neovim's
system
call, Ormolu printsstty: 'standard input': Inappropriate ioctl for device
as the first line in stdout.The most important issue is not that ormolu doesn't play well with Neovim, but that it outputs an error message to stdout. This breaks plugins like vim-ormolu in Neovim. Those plugins run Ormolu and replace the current buffer with whatever Ormolu provides in stdout (assuming Ormolu doesn't return any errors).
To Reproduce
/tmp/Main.hs
withmain :: IO ()
nvim /tmp/Main.hs
echo output
The last command will display
Expected behavior
Ormolu should print only
main :: IO ()
to stdout.Environment
Additional Context
My hypothesis is that error is produced by the Text printing function as the problem doesn't appear when I run Ormolu in the inplace mode.