Showing shell output in GVim's window

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Showing shell output in GVim's window

Anton Shepelev
Hello, all

While working with the console version of Vim, the output of
the ! command is shown in the same terminal window, whereas
with GVim a new console window pops up. Is it possible to
configure GVim to show the shell in its own wiindow for a
more unified experience?  With the current behavior, the
edit-compile-test cycle in GVim is somewhat uncomfortable.

--
Please, do not forward replies to my e-mail.

--
--
You received this message from the "vim_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Showing shell output in GVim's window

Tony Mechelynck
On Fri, Oct 19, 2018 at 10:58 PM Anton Shepelev <[hidden email]> wrote:
>
> Hello, all
>
> While working with the console version of Vim, the output of
> the ! command is shown in the same terminal window, whereas
> with GVim a new console window pops up. Is it possible to
> configure GVim to show the shell in its own wiindow for a
> more unified experience?  With the current behavior, the
> edit-compile-test cycle in GVim is somewhat uncomfortable.

This may either be operating-system-dependent, or else depend on some option.
In my Big gvim for Linux64, and with my usual vimrc, the multiline
output of ! external commands appears at the very bottom of the Vim
screen, pushing all windows up, and ends with a |hit-enter-prompt|,
just as if it were a multiline message frm Vim itself.

Best regards,
Tony.

--
--
You received this message from the "vim_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Showing shell output in GVim's window

Bram Moolenaar
In reply to this post by Anton Shepelev

Anton Shepelev wrote:

> While working with the console version of Vim, the output of
> the ! command is shown in the same terminal window, whereas
> with GVim a new console window pops up. Is it possible to
> configure GVim to show the shell in its own wiindow for a
> more unified experience?  With the current behavior, the
> edit-compile-test cycle in GVim is somewhat uncomfortable.

With Vim 8.1 and later, you can use ":set go+=!".
It doesn't work perfectly, because of how it uses a virtual console.

--
"Marriage is a wonderful institution...
but who wants to live in an institution?"
 - Groucho Marx

 /// Bram Moolenaar -- [hidden email] -- 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_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Showing shell output in GVim's window

Tony Mechelynck
On Sat, Oct 20, 2018 at 11:03 AM Bram Moolenaar <[hidden email]> wrote:
> With Vim 8.1 and later, you can use ":set go+=!".
> It doesn't work perfectly, because of how it uses a virtual console.

Ah, that's why I get what Anton wants: my vimrc indeed sets the ! flag
in 'guioptions'. Of course it means that external commands are run in
gvim's "dumb" console (glass teletype) and won't be able to use
backward cursor moves as in ncurses.

Best regards,
Tony.

--
--
You received this message from the "vim_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Showing shell output in GVim's window

Bram Moolenaar

Tony wrote:

> On Sat, Oct 20, 2018 at 11:03 AM Bram Moolenaar <[hidden email]> wrote:
> > With Vim 8.1 and later, you can use ":set go+=!".
> > It doesn't work perfectly, because of how it uses a virtual console.
>
> Ah, that's why I get what Anton wants: my vimrc indeed sets the ! flag
> in 'guioptions'. Of course it means that external commands are run in
> gvim's "dumb" console (glass teletype) and won't be able to use
> backward cursor moves as in ncurses.

Since it's now using the built-in terminal emulator, it's a full
terminal, not "dumb".  The problem on MS-Windows is that redirection
doesn't work properly.

--
"After a few years of marriage a man can look right at a woman
without seeing her and a woman can see right through a man
without looking at him."
 - Helen Rowland

 /// Bram Moolenaar -- [hidden email] -- 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_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Showing shell output in GVim's window

Tony Mechelynck
On Sat, Oct 20, 2018 at 4:24 PM Bram Moolenaar <[hidden email]> wrote:

>
>
> Tony wrote:
>
> > On Sat, Oct 20, 2018 at 11:03 AM Bram Moolenaar <[hidden email]> wrote:
> > > With Vim 8.1 and later, you can use ":set go+=!".
> > > It doesn't work perfectly, because of how it uses a virtual console.
> >
> > Ah, that's why I get what Anton wants: my vimrc indeed sets the ! flag
> > in 'guioptions'. Of course it means that external commands are run in
> > gvim's "dumb" console (glass teletype) and won't be able to use
> > backward cursor moves as in ncurses.
>
> Since it's now using the built-in terminal emulator, it's a full
> terminal, not "dumb".  The problem on MS-Windows is that redirection
> doesn't work properly.

The binary where I tested it was built with -terminal. There (with !
in 'guioptions'), the output of external commands appears in the
command-line area, pushing all windows upwards. It may be different in
a gvim with +terminal — I have one but I only rarely use it. Sorry for
jumping to conclusions.

Here are the configuration parameters for my "usual" Vim:

export CONF_OPT_GUI='--enable-gui=gtk2'
export CONF_OPT_MULTIBYTE='--enable-multibyte'
export CONF_OPT_AUTOSERVE='--enable-autoservername'
export CONF_OPT_FEAT='--with-features=big'
export CONF_OPT_COMPBY='"--with-compiledby=[hidden email]"'

Multibyte and GTK2 but no interpreted language interfaces, no
terminal, and none of the few features normally present in Huge but
not in Big. In addition to this, I set +xterm_save and -tag_old_static
by patching feature.h because AFAIK there are no configure arguments
for them.

Best regards,
Tony.

--
--
You received this message from the "vim_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Showing shell output in GVim's window

Anton Shepelev
In reply to this post by Bram Moolenaar
Bram Moolenaar:

> With Vim 8.1 and later, you can use ":set go+=!".

With this option, I get:

  winpty-agent Createprocess failed:

followed by an invocation of winpty-agent with a pipe name
and --create-desktop.  At the end it says: "err=0xc1".  I
don't know how to copy this error message from GVim's
window.

> The problem on MS-Windows is that redirection doesn't work
> properly.

If you meant the redirection of stdin, stdout, and stderr,
then what is the problem?  I have recently written a cross-
platform program in Pascal that runs an extermal command
with redirected input and outputs.  On Windows, it starts
the external process using CreateProcess(), then enters a
loop where it polls the output handles without blocking with
PeekNamedPipe() and ReadFile(), and writes to the input
handle with WriteFile().  PeekNamedPipe() does work with
anonymous pipes.

--
Please, do not forward replies to my e-mail.

--
--
You received this message from the "vim_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Showing shell output in GVim's window

Christian Brabandt

On So, 21 Okt 2018, Anton Shepelev wrote:

> With this option, I get:
>
>   winpty-agent Createprocess failed:
>
> followed by an invocation of winpty-agent with a pipe name
> and --create-desktop.  At the end it says: "err=0xc1".  I
> don't know how to copy this error message from GVim's
> window.

Just a guess, but is your winpty.dll of the same architecture as your
Vim (32bit vs 46bit)?

Best,
Christian
--
Wenn ich irre, kann es jeder bemerken, wenn ich lüge, nicht.
                -- Goethe, Maximen und Reflektionen, Nr. 225

--
--
You received this message from the "vim_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Showing shell output in GVim's window

Anton Shepelev
Christian Brabandt to Anton Shepelev:

> Just a guess, but is your winpty.dll of the same
> architecture as your Vim (32bit vs 46bit)?

So it seems!  When I try to run it manually in my 32-bit
Windows XP, it says it is not a valid Win32 application,
which is very strange, because it came with the 32-bit
distribution of GVim.  Is it a packaging error?

--
Please, do not forward replies to my e-mail.

--
--
You received this message from the "vim_use" 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_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.