Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I occasionally use gvim -f to start gvim but force the shell to wait for the gvim session to end before resuming execution of whatever it's doing (for instance, I usually edit my bash aliases using an alias that calls gvim -f then reloads my .bashrc file after I quit gvim).

Sometimes, however, I realize that I'd like to continue editing the file, but I also want to resume work in the shell. For instance, in the example use above, sometimes I'd like to test whether an alias I've just written will actually do what I want, and if not, I'd like to fix it to behave correctly. (Yes, I realize that there are several other ways of ccomplishing this; it's just an example.)

Is it possible to return control to the shell from a gvim -f command WITHOUT closing the gvim session?

(For instance, is there a way to make gvim send some sort of spurious "I'm done" signal back to the shell, but retain control? Or is there a way to turn the current process into a background process without killing it?)

(I'm adding the bash tag because that's the shell I'm currently using, but ideally I'd like a shell-agnostic solution.)

EDIT: original post mentioned "disowning the child process," which, I now realize, is actually not what I'm trying to do.

share|improve this question
Use ctrl-z to suspend the gvim process and then bg to put it in the brackgroung from the shell? – Etan Reisner Nov 1 '13 at 18:48
That is precisely what I needed. Thank you. If you write that up as an answer, I'll accept it. – Kyle Strand Nov 1 '13 at 19:10
up vote 1 down vote accepted

I don't know of a way to do this from within gvim but normal shell job control operations can do this.

Use ctrl-z to suspend the foreground gvim process and then use bg to resume the process in the background and allow the shell to continue normal operation. (This is essentially all gvim is doing without -f anyway though in a slightly different manner.)

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .