0

I'm running gvim with bash as the shell. When I run the :sh command, the various colors print out, like the following:

:sh
?]0;~/src
?[32muser@machine ?[33m~/src?[0m
$

This is obviously a version of my customized prompt without any of the terminal codes being interpreted. Is there an option that can be passed to bash from gvim such that it will run in some sort of plain mode without the escapes?

Also, if I perform the same actions from vim running in a terminal, the issue never arises and the codes are interpreted so this question is specific to how to make the :sh command and bash play nicely with gvim.

1
  • add those color codes to your prompt only if you have an interactive shell? Commented Apr 21, 2017 at 11:35

1 Answer 1

0

According :help shell you have to execute :set shell=/path/to/shell before executing :sh. When you run :sh from a terminal variable like $SHELL can be retrieve since it is an environment variable from your terminal, so subprocess inherit these variable.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .