fish-shell/tests/pexpects/nullterm.py
ridiculousfish bd9c6a64e3 Be careful to not touch curses variables if cur_term is null
Curses variables like `enter_italics_mode` are secretly defined to
dereference through the `cur_term` variable. Be sure we do not read or
write these curses variables if cur_term is NULL. See #8873, #8875.

Add a regression test.
2022-04-16 13:26:56 -07:00

17 lines
380 B
Python

#!/usr/bin/env python3
import os
from pexpect_helper import SpawnedProc
# Regression test for #8873.
# fish doesn't crash if TERM is unset.
env = os.environ.copy()
env.pop("TERM", None)
sp = SpawnedProc(env=env)
sendline, expect_prompt = sp.sendline, sp.expect_prompt
expect_prompt()
sendline("set_color --italics")
expect_prompt()
sendline("set_color normal")
expect_prompt()