Tristan Van Berkom pushed to branch master at BuildStream / buildstream
Commits:
-
b0d1aa83
by Tristan Van Berkom at 2018-08-23T05:54:05Z
1 changed file:
Changes:
... | ... | @@ -28,9 +28,9 @@ from .app import App |
28 | 28 |
#
|
29 | 29 |
def _osc_777_supported():
|
30 | 30 |
|
31 |
- term = os.environ['TERM']
|
|
31 |
+ term = os.environ.get('TERM')
|
|
32 | 32 |
|
33 |
- if term.startswith('xterm') or term.startswith('vte'):
|
|
33 |
+ if term and (term.startswith('xterm') or term.startswith('vte')):
|
|
34 | 34 |
|
35 | 35 |
# Since vte version 4600, upstream silently ignores
|
36 | 36 |
# the OSC 777 without printing garbage to the terminal.
|
... | ... | @@ -39,10 +39,10 @@ def _osc_777_supported(): |
39 | 39 |
# will trigger a desktop notification and bring attention
|
40 | 40 |
# to the terminal.
|
41 | 41 |
#
|
42 |
- vte_version = os.environ['VTE_VERSION']
|
|
42 |
+ vte_version = os.environ.get('VTE_VERSION')
|
|
43 | 43 |
try:
|
44 | 44 |
vte_version_int = int(vte_version)
|
45 |
- except ValueError:
|
|
45 |
+ except (ValueError, TypeError):
|
|
46 | 46 |
return False
|
47 | 47 |
|
48 | 48 |
if vte_version_int >= 4600:
|