Use the $TERM value from fish's computed environment for ncurses setup

Previously, the process's inherited $TERM value would be used.
This prevented users from being able to set $TERM in their config.fish files.

To make matters worse, the error message would print the computed $TERM value,
giving the mistaken impression that it was being used.

Signed-off-by: David Adam <zanchey@ucc.gu.uwa.edu.au>
This commit is contained in:
Chris Pick 2015-08-21 20:46:56 -04:00 committed by David Adam
parent 7f28acc5ed
commit c5bc221b27

View File

@ -466,7 +466,7 @@ int input_init()
const env_var_t term = env_get_string(L"TERM");
int errret;
if (setupterm(0, STDOUT_FILENO, &errret) == ERR)
if (setupterm(const_cast<char *>(wcs2string(term).c_str()), STDOUT_FILENO, &errret) == ERR)
{
debug(0, _(L"Could not set up terminal"));
if (errret == 0)