Skip to content

Commit 9dc5875

Browse files
authored
Fix z -I in ranger_zlua.py
`z -I` had 2 issues: - it used `subprocess.check_output()`, but didn't UTF-8 decode the string (like the `if mode` statement's `else` branch does on row 80) - it wasn't actually interactive, like `-I` is supposed to be (subprocess.check_output()` is not interactive) I'm not sure why `-I` mode was originally treated differently from e.g. `-i` mode, but the same code works for both. I took the `redraw_window` console command from the original `-I` mode code, because without it the screen updates a bit slower, causing an ugly "flash".
1 parent c90279b commit 9dc5875

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

ranger_zlua.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,10 @@ def execute (self):
6969
p = self.fm.execute_command(cmd + ' 2>&1 | less +G', universal_newlines=True)
7070
stdout, stderr = p.communicate()
7171
else:
72-
if mode == '-I':
73-
os.environ['_ZL_FZF_HEIGHT'] = '0'
74-
path = subprocess.check_output([PATH_LUA, PATH_ZLUA, '--cd'] + args)
75-
self.fm.execute_console('redraw_window')
76-
else:
77-
p = self.fm.execute_command(cmd, universal_newlines=True, stdout=subprocess.PIPE)
78-
stdout, stderr = p.communicate()
79-
path = stdout.rstrip('\n')
72+
p = self.fm.execute_command(cmd, universal_newlines=True, stdout=subprocess.PIPE)
73+
stdout, stderr = p.communicate()
74+
path = stdout.rstrip('\n')
75+
self.fm.execute_console('redraw_window')
8076
if path and os.path.exists(path):
8177
self.fm.cd(path)
8278
else:

0 commit comments

Comments
 (0)