Marius Gedminas wrote:

> On Tue, Mar 13, 2018 at 01:56:03PM +0100, Bram Moolenaar wrote:
> > Currently the :terminal command keeps the window open after the job
> > exists.  The idea is that you have a chance to see the job output, you
> > might want to yank it.  Closing the window automatically might mean you
> > loose that text, there is no way to get it back.
> > 
> > However, in practice I find that I mostly want the window to close as
> > soon as the job finishes.  So how about changing the default behavior?
> > 
> > Currently:
> >     :terminal               requires "exit<CR>:q<CR>" to close
> >     :terminal ++close       requires "exit<CR>" to close
> > 
> > With different default:
> >     :terminal               requires "exit<CR>" to close
> >     :terminal ++noclose     requires "exit<CR>:q<CR>" to close
> > 
> > Good idea or bad idea?
> 
> Personally I like the current behavior.
> 
> I use vim's :terminal to run a couple of web servers (a Python one for a
> web app backend, and a Node.js one for the app's frontend).  These
> autorestart when the source code on disk changes, but sometimes (e.g. when I
> save a file during an unfinished refactoring) one of the servers
> crashes.  I like being able to see the error and to restart the command
> in the same terminal window, for which I use a little user-defined
> command:
> 
>   command! TermRestart exec 'term ++curwin' expand("%")[1:]
> 
> 
> Maybe an option would be better?  Then people to select which one they
> prefer in their vimrc, and they wouldn't have to repeat their preference
> on every :terminal command?

An option is not nice for people who write plugins, they have to make
sure it works both with and without the option set.

I currently think that the behavior to close-by-default only when no
command argument is passed is the best solution.  This assumes that the
user intentionally ends the shell, which seems like a safe assumption.

If I understand it correctly this will also work for your use case.

-- 
hundred-and-one symptoms of being an internet addict:
18. Your wife drapes a blond wig over your monitor to remind you of what she
    looks like.

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui