Skip to content

Commit 7b6ed71

Browse files
authored
Merge pull request #3 from drmikecrowe/master
Support xonsh>=0.9.18 -- fixes #2 (ptk_shell_type)
2 parents c4a7e2e + 30fb38d commit 7b6ed71

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

xontrib/powerline2.xsh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@ import os
22
from os import path
33
from collections import namedtuple
44
from time import strftime
5-
from xonsh.platform import ptk_shell_type
5+
try:
6+
from xonsh.platform import ptk_shell_type
7+
ptk2 = ptk_shell_type() == 'prompt_toolkit2'
8+
except ImportError:
9+
ptk2 = True
610

711

812
__all__ = ()
@@ -30,7 +34,7 @@ $PL_DEFAULT_COLORS = {
3034
"full_rtns": ("WHITE", "RED", "#444"),
3135
}
3236

33-
if ptk_shell_type() == 'prompt_toolkit2':
37+
if ptk2:
3438
$PTK_STYLE_OVERRIDES['bottom-toolbar'] = 'noreverse'
3539

3640
modes = {

0 commit comments

Comments
 (0)