Skip to content
Snippets Groups Projects
Commit a53b7e21 authored by Tristan Van Berkom's avatar Tristan Van Berkom
Browse files

_frontend/linuxapp.py: Fixing fallout from !693

When fixing terminal notifications, I had introduced a bug
with accesses to `os.environ` which triggered KeyError, this
patch fixes it.
parent be8cb8ae
Branches
Tags
Loading
Pipeline #28493532 canceled
......@@ -28,9 +28,9 @@ from .app import App
#
def _osc_777_supported():
term = os.environ['TERM']
term = os.environ.get('TERM')
if term.startswith('xterm') or term.startswith('vte'):
if term and (term.startswith('xterm') or term.startswith('vte')):
# Since vte version 4600, upstream silently ignores
# the OSC 777 without printing garbage to the terminal.
......@@ -39,10 +39,10 @@ def _osc_777_supported():
# will trigger a desktop notification and bring attention
# to the terminal.
#
vte_version = os.environ['VTE_VERSION']
vte_version = os.environ.get('VTE_VERSION')
try:
vte_version_int = int(vte_version)
except ValueError:
except (ValueError, TypeError):
return False
if vte_version_int >= 4600:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment