Issue with gvim

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

Issue with gvim

David Ohlemacher
Hi all,

When I use ":sh" within gvim, I see this:
:sh
Warning: no access to tty (Inappropriate ioctl for device).
Thus no job control in this shell.
?<totally mangled prompt because it does not understand tty color codes> ?
At this point, I can enter commands, but the shell is broken. Backspace key only adds ^H. Letters typed overwrite each other. ls command should display with color coded output, but instead displays the color codes as text, etc.

If I run bash from within a tcsh terminal then start gvim, it fails identically.
If I run vim (non graphical), it works, but the shell takes the whole terminal window even if I split it first.

I never see this error except w/in vim.
How can I fix this?  

I am running ubuntu mav, and tcsh (6.17.00). 

Thanks,
-d

:version (from gvim)
VIM - Vi IMproved 7.2 (2008 Aug 9, compiled Sep 28 2010 11:02:36)
Included patches: 1-330
Compiled by buildd@
Huge version with GTK2-GNOME GUI.  Features included (+) or not (-):
+arabic +autocmd +balloon_eval +browse ++builtin_terms +byte_offset +cindent +clientserver +clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments +cryptv +cscope +cursorshape +dialog_con_gui +diff
 +digraphs +dnd -ebcdic +emacs_tags +eval +ex_extra +extra_search +farsi +file_in_path +find_in_path +float +folding -footer +fork() +gettext -hangul_input +iconv +insert_expand +jumplist +keymap +langmap
+libcall +linebreak +lispindent +listcmds +localmap +menu +mksession +modify_fname +mouse +mouseshape +mouse_dec +mouse_gpm -mouse_jsbterm +mouse_netterm -mouse_sysmouse +mouse_xterm +multi_byte
+multi_lang -mzscheme +netbeans_intg -osfiletype +path_extra +perl +postscript +printer +profile +python +quickfix +reltime +rightleft +ruby +scrollbind +signs +smartindent -sniff +startuptime +statusline
-sun_workshop +syntax +tag_binary +tag_old_static -tag_any_white +tcl +terminfo +termresponse +textobjects +title +toolbar +user_commands +vertsplit +virtualedit +visual +visualextra +viminfo +vreplace
+wildignore +wildmenu +windows +writebackup +X11 -xfontset +xim +xsmp_interact +xterm_clipboard -xterm_save
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
      user exrc file: "$HOME/.exrc"
  system gvimrc file: "$VIM/gvimrc"
    user gvimrc file: "$HOME/.gvimrc"
    system menu file: "$VIMRUNTIME/menu.vim"
  fall-back for $VIM: "/usr/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK  -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/in
clude/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12   -DORBIT2=1 -pthread -D_REENTRANT -
I/usr/include/libgnomeui-2.0 -I/usr/include/libart-2.0 -I/usr/include/gconf/2 -I/usr/include/gnome-keyring-1 -I/usr/include/libgnome-2.0 -I/usr/include/libbonoboui-2.0 -I/usr/include/libgnomecanvas-2.0 -I/u
sr/include/gtk-2.0 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/gnome-vfs-2.0 -I/usr/lib/gnome-vfs-2.0/include -I/usr/include/orbit-2.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/lib
bonobo-2.0 -I/usr/include/bonobo-activation-2.0 -I/usr/include/libxml2 -I/usr/include/pango-1.0 -I/usr/include/gail-1.0 -I/usr/include/freetype2 -I/usr/include/atk-1.0 -I/usr/lib/gtk-2.0/include -I/usr/incl
ude/cairo -I/usr/include/gio-unix-2.0/ -I/usr/include/pixman-1 -I/usr/include/libpng12     -Wall -g -O2    -D_REENTRANT -D_GNU_SOURCE -DDEBIAN  -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_
FILE_OFFSET_BITS=64  -I/usr/lib/perl/5.10/CORE  -I/usr/include/python2.6 -pthread -I/usr/include/tcl8.4  -D_REENTRANT=1  -D_THREAD_SAFE=1  -D_LARGEFILE64_SOURCE=1  -I/usr/lib/ruby/1.8/x86_64-linux
Linking: gcc   -L. -Wl,-Bsymbolic-functions -rdynamic -Wl,-export-dynamic  -Wl,-E  -Wl,--as-needed -o vim   -pthread -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pix
buf-2.0 -lcairo -lpng12 -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lrt -lglib-2.0     -lgnomeui-2 -lbonoboui-2 -lgnomevfs-2 -lgnomecanvas-2 -lgnome-2 -lpopt -lbonobo-2 -l
bonobo-activation -lORBit-2 -lart_lgpl_2 -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lpng12 -lgconf-2 -lgmod
ule-2.0 -lgobject-2.0 -lgthread-2.0 -lrt -lglib-2.0   -lXt -lncurses -lselinux  -lacl -lgpm -Wl,-E  -fstack-protector -L/usr/local/lib  -L/usr/lib/perl/5.10/CORE -lperl -L/usr/lib/python2.6/config -lpython2
.6 -lutil -Xlinker -export-dynamic -Wl,-O1 -Wl,-Bsymbolic-functions -L/usr/lib -ltcl8.4 -lieee -lruby1.8 -lrt -lm
--
David Ohlemacher
Senior Software Engineer
Scientific Solutions Inc. 
99 Perimeter Rd Nashua New Hampshire 03063
603-880-3784

. o .
. . o
o o o

--
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
Reply | Threaded
Open this post in threaded view
|

Re: Issue with gvim

Jean-Rene David-2
* David Ohlemacher [2011.05.05 12:30]:
> Hi all,
>
> When I use ":sh" within gvim, I see this:
>
>    :sh
>    Warning: no access to tty (Inappropriate ioctl for device).
>    Thus no job control in this shell.
>    ?<totally mangled prompt because it does not understand tty color
>    codes> ?

When you type ':sh' from gvim, you are provided a rather rudimentary
terminal. You don't end up in an xterm. So functionality is reduced.

:h gui-pty

> At this point, I can enter commands, but the shell is broken.

The shell is fine. It's the terminal that has only limited
functionality.

> If I run bash from within a tcsh terminal then start gvim, it fails
> identically.

You seem to use 'shell' and 'terminal' interchangeably. They are not the
same thing. 'tcsh' and 'bash' are shells, not terminals.

It doesn't matter *how* you start gvim. You will always get a limited
functionality terminal from it.

> If I run vim (non graphical), it works,

Of course it does. When you run vim you're already in a full-featured
terminal.

> but the shell takes the whole terminal window even if I split it
> first.

The terminal is always the whole window. It doesn't matter if you have
split windows in vim. When you type ':sh' you are not in vim any more so
whatever window layout you had is irrelevant.

--
JR

--
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
Reply | Threaded
Open this post in threaded view
|

Re: Issue with gvim

Tim Chase
On 05/05/2011 12:09 PM, Jean-Rene David wrote:
> You seem to use 'shell' and 'terminal' interchangeably. They
> are not the same thing. 'tcsh' and 'bash' are shells, not
> terminals.
>
> It doesn't matter *how* you start gvim. You will always get a
> limited functionality terminal from it.

You can hack around it by spawning a real(ish)
(pseudo)terminal(emulator).  Just in case you didn't have enough
parens in that sentence, you can do something like one of the
following:

   :!rxvt &
   :!rxvt -e /bin/bash &

or if you want to be more flexible you can do something like

   :let g:term_emulator_cmd='rxvt -e'
   " :let g:term_emulator_cmd='xterm -e'
   :exec '!'.(g:term_emulator).' '.&shell.'&'

The terminal "&" is optional depending on whether you want to
spawn the term in the background or if you want to wait until the
term-emulator exits before returning to vim.

Any/all of those can be readily mapped or have a :command made of
them to make them less verbose when calling them.

-tim



--
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
Reply | Threaded
Open this post in threaded view
|

Re: Issue with gvim

David Ohlemacher
In reply to this post by Jean-Rene David-2
OK, thanks for the help link.

It does say commands like ls and grep mostly work fine.  But it seems
only for a very bare-bones shell.    I was hoping it was possible to get
rudimentary commands like ls to work.    Is there a way to configure my
.gvimrc file to use another special initialization file?  Maybe through
the use of bash's --init-file option.

The help does say how to fix backspaces, but to me it is probably not
worth using the sh command at all in gvim unless I can get a readable
stdout.

When I use vim, I almost always use it within screen.

On 05/05/2011 01:09 PM, Jean-Rene David wrote:

> * David Ohlemacher [2011.05.05 12:30]:
>> Hi all,
>>
>> When I use ":sh" within gvim, I see this:
>>
>>     :sh
>>     Warning: no access to tty (Inappropriate ioctl for device).
>>     Thus no job control in this shell.
>>     ?<totally mangled prompt because it does not understand tty color
>>     codes>  ?
> When you type ':sh' from gvim, you are provided a rather rudimentary
> terminal. You don't end up in an xterm. So functionality is reduced.
>
> :h gui-pty
>> At this point, I can enter commands, but the shell is broken.
> The shell is fine. It's the terminal that has only limited
> functionality.
>
>> If I run bash from within a tcsh terminal then start gvim, it fails
>> identically.
> You seem to use 'shell' and 'terminal' interchangeably.
No...
> They are not the
> same thing. 'tcsh' and 'bash' are shells, not terminals.
> It doesn't matter *how* you start gvim. You will always get a limited
> functionality terminal from it.
Yes I know this.   I was trying to say   "a terminal running tcsh
running bash" but this seemed rather verbose.  To me, a tcsh terminal is
obviously a terminal running the tcsh shell.
>> If I run vim (non graphical), it works,
> Of course it does. When you run vim you're already in a full-featured
> terminal.
>
>> but the shell takes the whole terminal window even if I split it
>> first.
> The terminal is always the whole window. It doesn't matter if you have
> split windows in vim. When you type ':sh' you are not in vim any more so
> whatever window layout you had is irrelevant.


--
David Ohlemacher
Senior Software Engineer
Scientific Solutions Inc.
99 Perimeter Rd Nashua New Hampshire 03063
603-880-3784

. o .
. . o
o o o

--
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
Reply | Threaded
Open this post in threaded view
|

Re: Issue with gvim

David Ohlemacher
In reply to this post by Tim Chase
Interesting...

Thanks Tim.  I'll play with it.   I could specify a --init-file as well with that, if needed.

-d

On 05/05/2011 01:24 PM, Tim Chase wrote:
On 05/05/2011 12:09 PM, Jean-Rene David wrote:
You seem to use 'shell' and 'terminal' interchangeably. They
are not the same thing. 'tcsh' and 'bash' are shells, not
terminals.

It doesn't matter *how* you start gvim. You will always get a
limited functionality terminal from it.
You can hack around it by spawning a real(ish) 
(pseudo)terminal(emulator).  Just in case you didn't have enough 
parens in that sentence, you can do something like one of the 
following:

   :!rxvt &
   :!rxvt -e /bin/bash &

or if you want to be more flexible you can do something like

   :let g:term_emulator_cmd='rxvt -e'
   " :let g:term_emulator_cmd='xterm -e'
   :exec '!'.(g:term_emulator).' '.&shell.'&'

The terminal "&" is optional depending on whether you want to 
spawn the term in the background or if you want to wait until the 
term-emulator exits before returning to vim.

Any/all of those can be readily mapped or have a :command made of 
them to make them less verbose when calling them.

-tim




-- 
David Ohlemacher
Senior Software Engineer
Scientific Solutions Inc. 
99 Perimeter Rd Nashua New Hampshire 03063
603-880-3784

. o .
. . o
o o o

--
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
Reply | Threaded
Open this post in threaded view
|

Re: Issue with gvim

Tony Mechelynck
In reply to this post by David Ohlemacher
On 05/05/11 20:05, David Ohlemacher wrote:

> OK, thanks for the help link.
>
> It does say commands like ls and grep mostly work fine. But it seems
> only for a very bare-bones shell. I was hoping it was possible to get
> rudimentary commands like ls to work. Is there a way to configure my
> .gvimrc file to use another special initialization file? Maybe through
> the use of bash's --init-file option.
>
> The help does say how to fix backspaces, but to me it is probably not
> worth using the sh command at all in gvim unless I can get a readable
> stdout.
>
> When I use vim, I almost always use it within screen.
>

You will get a readable stdout if the external programs you invoke from
gvim can work on a dumb teletype terminal, yes, nothing more than an
electric typewriter hammering away at a roll of real paper. This means:
- they move the cursor only forward, either to the next character when
typing, or to the next line by means of an end-of-line signal
(carriage-return and/or linefeed depending on OS)
- they don't try to clear the screen, or to move the cursor to some
specified (x, y) position
- they don't try to change the foreground and background colours, or to
set underline, italic or bold.
- I *think* it would also be better to avoid starting any GUI program
from a gvim shell command.

In particular, on Unix, "grep" and "more" will work; "make" and the
compilers it invokes will probably work but it might be easier to let
them run in batch mode with stdout and stderr logged to a file and
examine that log when they're finished; "ls" will work if you use it
with --color=no (but using netrw will in some cases be nicer); "less"
won't work; "man" will probably not work since its default pager is
"less" (you might make it work by setting MANPAGER=more but of course
you'll then lose the ability to move back and forth through the manual),
and so forth.


About backspace vs. ^H, see :help gui-pty-erase, just a few lines after
that help tag Jean-René gave you.


Best regards,
Tony.
--
May a diseased yak take a liking to your sister.

--
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
Reply | Threaded
Open this post in threaded view
|

Re: Issue with gvim

Gary Johnson-4
On 2011-05-06, Tony Mechelynck wrote:

> - I *think* it would also be better to avoid starting any GUI program
> from a gvim shell command.

Doing that should be OK.  The GUI program will inherit gvim's
environment, which was good enough to start gvim, so it should be
good enough to start any other GUI program.

> In particular, on Unix, "grep" and "more" will work; "make" and the
> compilers it invokes will probably work but it might be easier to let
> them run in batch mode with stdout and stderr logged to a file and
> examine that log when they're finished; "ls" will work if you use it
> with --color=no (but using netrw will in some cases be nicer); "less"
> won't work;

Less will work, although with the warning that "terminal is not
fully functional".  The behavior will be a little odd.  For example,
to scroll backward, less redraws the entire screen.  But it works.

> "man" will probably not work since its default pager is
> "less" (you might make it work by setting MANPAGER=more but of course
> you'll then lose the ability to move back and forth through the manual),
> and so forth.

Man works, too, but is ugly unless you execute "-m" to set the short
prompt.  Otherwise, it leaves "byte" and "%" on the screen if you
scroll down by less than a full page.

Best regards,
Gary

--
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