HomePhabricator

Save and restore previous terminal after setting the terminal for checking if…

Authored by augusto2112 on Mar 11 2021, 1:17 AM.

Description

Save and restore previous terminal after setting the terminal for checking if terminal supports colors.

The call to "set_curterm" inside the "terminalHasColors" function breaks
the EditLine configuration on some Linux distributions, causing certain
characters that have functions bound to them to not show up and
backspace to stop deleting characters (only visually). This patch
ensures that term struct is restored after the routine for cheking if
terminal supports colors is done, which fixes the aforementioned issue.

Reviewed By: labath

Differential Revision: https://reviews.llvm.org/D95230