'guicursor': Disable by default for unknown terminals.

User can still set guicursor explicitly in init.vim.

Closes #5990
Closes #6403
This commit is contained in:
Justin M. Keyes
2017-04-04 02:37:43 +02:00
parent 3ccd59ee82
commit e348e256f3
5 changed files with 33 additions and 14 deletions

View File

@@ -889,3 +889,17 @@ bool os_setenv_append_path(const char *fname)
}
return false;
}
/// Returns true if the terminal can be assumed to silently ignore unknown
/// control codes.
bool os_term_is_nice(void)
{
#if defined(__APPLE__) || defined(WIN32)
return true;
#else
const char *vte_version = os_getenv("VTE_VERSION");
return (vte_version && atoi(vte_version) >= 3900)
|| NULL != os_getenv("KONSOLE_PROFILE_NAME")
|| NULL != os_getenv("KONSOLE_DBUS_SESSION");
#endif
}