Skip to content

Commit

Permalink
Use the $TERM value from fish's computed environment for ncurses setup
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Chris Pick authored and zanchey committed Sep 9, 2015
1 parent 7f28acc commit c5bc221
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/input.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit c5bc221

Please sign in to comment.