Skip to content
This repository was archived by the owner on Mar 12, 2020. It is now read-only.

Commit 98568b6

Browse files
committed
If process was killed and stream wrote to output, then write newline
1 parent 4e39564 commit 98568b6

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

SQLToolsAPI/Command.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,20 @@ def run(self):
6767
if self.stream:
6868
self.process.stdin.write(self.query.encode())
6969
self.process.stdin.close()
70+
hasWritten = False
71+
7072
for line in self.process.stdout:
7173
self.callback(line.decode(self.encoding,
7274
'replace').replace('\r', ''))
75+
hasWritten = True
7376

7477
queryTimerEnd = time.time()
7578
# we are done with the output, terminate the process
7679
if self.process:
7780
self.process.terminate()
81+
else:
82+
if hasWritten:
83+
self.callback('\n')
7884

7985
if self.options['show_query']:
8086
formattedQueryInfo = self._formatShowQuery(self.query, queryTimerStart, queryTimerEnd)

0 commit comments

Comments
 (0)