From 831407d4cf591fd09b269d3e0f7b257e4fea37a3 Mon Sep 17 00:00:00 2001 From: fisk Date: Wed, 21 Jun 2017 13:12:20 +0100 Subject: [PATCH] Property identify iTerm instead of just checking if MacOS is being used --- adapter/__init__.py | 4 +--- adapter/implementations/NullAdapter.py | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/adapter/__init__.py b/adapter/__init__.py index b97e31d..029bea7 100644 --- a/adapter/__init__.py +++ b/adapter/__init__.py @@ -20,9 +20,7 @@ def identify(): if "TILIX_ID" in os.environ: return Tilix() - if sys.platform == "darwin": - # TODO: identify if we are actually using iTerm. - # This could be the stock terminal for all we know. + if os.environ.get("ITERM_PROFILE"): return ITerm() return NullAdapter() diff --git a/adapter/implementations/NullAdapter.py b/adapter/implementations/NullAdapter.py index c10fc0c..83f099a 100644 --- a/adapter/implementations/NullAdapter.py +++ b/adapter/implementations/NullAdapter.py @@ -2,7 +2,7 @@ from adapter.base import TerminalAdapterInterface class NullAdapter(TerminalAdapterInterface): - err = "Terminal emulator not supported." + err = "This terminal emulator is not supported." def clear(self): print(self.err)