#32 Closing cscope kills editor


I am attempting to use gedit as my editor when running cscope. To do so, I set my 'editor' to be a bash script which contains the following:

gedit $2 +$1 2> /dev/null &

When I close cscope, gedit also closes. How can I prevent this? I've tried other editors besides gedit but get the same result.


  • > When I close cscope, gedit also closes. How can I prevent this?

    You can't, because that's exactly how cscope calling an external editor is supposed to work. The $EDITOR is supposed to behave like a traditonal vi, i.e. run in the foreground, blocking cscope until you're done editing that file, then get you back to cscope.

    You would need something like (X)Emacs' server-mode + gnuclient/emacsclient method, where the big editor is run independently as an "editing server", and a small program ({gnu|emacs}client) hands editing requests to it. The difference to what you're doing is that {gnu|emacs}client blocks and waits until you close that particular file in (X)Emacs using C-x # instead of the usual C-x 0. This informs emacsclient that you're done editing that buffer, so emacsclient terminates itself and gives control back to the terminal. I have no idea whether gedit offers a feature like emacs' server mode --- but most likely it doesn't.

    • status: open --> pending
    • status: pending --> closed-out-of-date