mirror of
https://github.com/b-ryan/powerline-shell.git
synced 2026-09-10 07:26:28 -04:00
Merge b669a2b518 into 4b681d8318
This commit is contained in:
commit
775176749b
|
|
@ -8,6 +8,8 @@ import importlib
|
|||
import json
|
||||
from .utils import warn, py3, import_file
|
||||
import re
|
||||
import io
|
||||
import platform
|
||||
|
||||
|
||||
def _current_dir():
|
||||
|
|
@ -238,5 +240,9 @@ def main():
|
|||
segments.append(segment)
|
||||
for segment in segments:
|
||||
segment.add_to_powerline()
|
||||
|
||||
if platform.system() == 'Windows':
|
||||
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, 'utf-8' , line_buffering = True)
|
||||
|
||||
sys.stdout.write(powerline.draw())
|
||||
return 0
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ class Segment(ThreadedSegment):
|
|||
output = map(lambda l: int(l.split()[2].strip()),
|
||||
output_proc.communicate()[0].decode("utf-8").splitlines()[1:])
|
||||
self.num_jobs = output.count(os.getppid()) - 1
|
||||
else:
|
||||
elif platform.system() != 'Windows':
|
||||
pppid_proc = subprocess.Popen(['ps', '-p', str(os.getppid()), '-oppid='],
|
||||
stdout=subprocess.PIPE)
|
||||
pppid = pppid_proc.communicate()[0].decode("utf-8").strip()
|
||||
|
|
|
|||
Loading…
Reference in a new issue