Skip to content

Commit e3f3cc7

Browse files
committed
Revert "Don't use show_window for viewers"
This reverts commit 951c43d, fixing #1309
1 parent 0e3b124 commit e3f3cc7

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

viewers/command_viewer.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
strbase = basestring
2020

2121

22+
WINDOWS_SHELL = re.compile(r'\b(?:cmd|powershell)(?:.exe)?\b', re.UNICODE)
23+
24+
2225
# a viewer that runs a user-specified command
2326
class CommandViewer(BaseViewer):
2427

@@ -123,7 +126,11 @@ def _run_command(self, command, pdf_file, tex_file=None, line='', col=''):
123126

124127
external_command(
125128
command,
126-
cwd=os.path.split(pdf_file)[0]
129+
cwd=os.path.split(pdf_file)[0],
130+
# show the Window if not using a Windows shell, i.e., powershell or
131+
# cmd
132+
show_window=not bool(WINDOWS_SHELL.match(command[0]))
133+
if sublime.platform() == 'windows' else False
127134
)
128135

129136
def forward_sync(self, pdf_file, tex_file, line, col, **kwargs):

viewers/sumatra_viewer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ def _error_msg():
9999
try:
100100
external_command(
101101
[sumatra_binary] + commands,
102-
use_texpath=False
102+
use_texpath=False, show_window=True
103103
)
104104
except OSError:
105105
exc_info = sys.exc_info()
@@ -109,7 +109,7 @@ def _error_msg():
109109
try:
110110
external_command(
111111
[sumatra_exe] + commands,
112-
use_texpath=False
112+
use_texpath=False, show_window=True
113113
)
114114
except OSError:
115115
traceback.print_exc()

0 commit comments

Comments
 (0)