1

When I run the :sh command I see the following characters

enter image description here

If it is relevant, my default shell is zsh and it runs oh-my-zsh also
Thanks

Ralf
  • 9,197
  • 1
  • 11
  • 30
jagjordi
  • 161
  • 6

2 Answers2

3

You are doing this in GVim and this only provides a terminal with limited capabilities. The command echo $TERM returns "dumb". Might be your zsh /oh-my-zsh setup can't handle this.

It works for me (with bash) as my bash setups checks for terminal capabilities before configuring a colored PS1 or configuring colored output for ls or grep.

Vim 8.0.1609 added the guioption !, see :help 'go-!'. This provides a better terminal:

:set guioptions+=!

Then the "terminal" started by :sh supports colors.(tested with Vim 8.1.996 on Ubuntu: echo $TERM returns "xterm").

If you have Vim 8.0.747+, or better 8.1.x, you should use :terminal to start a terminal window inside GVim. See :help terminal.

If you are on an older version of Vim, you need to change your zsh setup to work properly on a dumb terminal. Google something like "zsh dumb terminal" or "oh-my-zsh dumb terminal".

Ralf
  • 9,197
  • 1
  • 11
  • 30
1

get this behavior when runing from a ssh from other station. It was due to bad interpretation of terminal code. changing the TERM variable solve the issue by limiting vi code used

TERM was set to 'linux' or 'xterm' to work

in my .bashrc and based on parent ssh process

# change terminal value for ssh (avoid weird char escape code in vi)
if [ $( pstree -s $$ | grep -c sshd ) -gt 0 ]
 then
   export TERM='linux'
 fi
NeronLeVelu
  • 111
  • 2