VanDyke Software Forums

VanDyke Software Forums (https://forums.vandyke.com/index.php)
-   General (https://forums.vandyke.com/forumdisplay.php?f=11)
-   -   VI color (https://forums.vandyke.com/showthread.php?t=12671)

samky2005 04-19-2017 05:48 PM

VI color
 
Hello

There were some discussion around getting color in VI just like Putty gives.
My SecureCRT doesn't get colors when I edit the file using VI.
I tried to change to ANSI, or Linux or Xterm with ANSI Color checked, but no luck.

Can anyone please shed some light here?
Thank you in advance.

Sam

jdev 04-19-2017 06:00 PM

Quote:

Originally Posted by samky2005 (Post 47311)
There were some discussion around getting color in VI just like Putty gives.
My SecureCRT doesn't get colors when I edit the file using VI.
I tried to change to ANSI, or Linux or Xterm with ANSI Color checked, but no luck.

Can anyone please shed some light here?

As described in the online Overview of Color Configuration in SecureCRT (see 2nd-to-last question), some applications like vi/vim won't send ANSI color codes if it doesn't have reason to believe that the terminal on the other end would know how to interpret/use them.

If you've already enabled the ANSI color option in SecureCRT, the next thing to try would be to make sure that your emulation in SecureCRT is set to "Xterm" instead of VT100 (VT100 is the default emulation in SecureCRT in all versions prior to 8.1.x, so if you've upgraded from an older version of SecureCRT to version 8.1.x, your emulation may still be set to VT100).

If you change the emulation from VT100 to Xterm, make sure the ANSI color option is enabled, and then reconnect using the modified session configuration, do you get colors as desired?

--Jake

samky2005 04-19-2017 07:43 PM

Thank you!
The secret source was to disconnect it and reconnect.

Sam

jdev 04-20-2017 10:15 AM

Quote:

Originally Posted by samky2005 (Post 47313)
Thank you!
The secret source was to disconnect it and reconnect.

Ah yes.

The terminal "type" (emulation) is arranged at the very start of a connection, when SecureCRT requests the remote start a shell on behalf of the authenticated user. This ends up being what the remote stores in the $TERM environment variable (unless there is a startup script in your remote profile that overrides this and sets it to something else).

If you change the emulation in SecureCRT while your connected, SecureCRT will begin to act as such, but remote apps won't know any difference until you either...
  1. Run export TERM=xterm within the remote shell (assumes bash) and then launch vi again (so it is initialized with shell as xterm).

    or

  2. Disconnect and reconnect (so that the remote shell is initiated with the new terminal type)

--Jake


All times are GMT -6. The time now is 02:23 AM.