<<< Date Index >>>     <<< Thread Index >>>

Re: Use gvim with mutt to compose email



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Monday, April  6 at 09:01 PM, quoth Dave Feustel:
> I currently have the mutt editor set to vim. I would like to 
> use gvim instead, but when I specify gvim and start a reply 
> to an email, gvim starts with an empty screen. Is there a 
> way to get mutt to start gvim with the message already loaded?

The reason that gvim starts with an empty screen is because of the way 
it detaches itself from the terminal.

The way mutt handles the editor is by creating a temporary file for 
the message, launching the editor, and waiting for it to exit. When 
(as far as mutt can tell) the editor exits, it reads and then deletes 
the temporary file. When you launch gvim, it creates a second gvim 
process that is detached from the terminal, and then the first 
(original) one exits. Mutt notices that this first one exited, and so 
deletes the temporary file. Thus, by the time the second gvim process 
has gotten underway, the temporary file is gone. More importantly, 
mutt is no longer paying attention to whatever gvim might do.

The way to fix this situation is to prevent gvim from disconnecting 
itself from the terminal, so that mutt can properly wait for it. Do 
this by setting $editor to "gvim -f"

Make sense?

~Kyle
- -- 
I have always found that mercy bears richer fruits than strict 
justice.
                                                     -- Abraham Lincoln
-----BEGIN PGP SIGNATURE-----
Comment: Thank you for using encryption!

iEYEARECAAYFAknaP9EACgkQBkIOoMqOI16FOwCgmaaeReRStRISK4nPv2JcZWKU
ALYAoLL86h3TvmcQFm+xKle/767WXqbW
=Nhfk
-----END PGP SIGNATURE-----