Commit b0d1aa83 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 cd0775eb
Loading
Loading
Loading
Loading
Loading
+4 −4
Original line number Original line Diff line number Diff line
@@ -28,9 +28,9 @@ from .app import App
#
#
def _osc_777_supported():
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
        # Since vte version 4600, upstream silently ignores
        # the OSC 777 without printing garbage to the terminal.
        # 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
        # will trigger a desktop notification and bring attention
        # to the terminal.
        # to the terminal.
        #
        #
        vte_version = os.environ['VTE_VERSION']
        vte_version = os.environ.get('VTE_VERSION')
        try:
        try:
            vte_version_int = int(vte_version)
            vte_version_int = int(vte_version)
        except ValueError:
        except (ValueError, TypeError):
            return False
            return False


        if vte_version_int >= 4600:
        if vte_version_int >= 4600: