Skip to content

Commit 85c10a4

Browse files
committed
bugfix:manage operations when using MSDOSplayer
1 parent 11b9c42 commit 85c10a4

File tree

5 files changed

+21
-6
lines changed

5 files changed

+21
-6
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"displayName": "MASM/TASM",
44
"publisher": "xsro",
55
"description": "DOS汇编语言开发环境和语法支持,win下安装即用,自带DOSBox.exe和TASM/MASM工具",
6-
"version": "0.5.2",
6+
"version": "0.5.3-beta.1",
77
"keywords": [
88
"dosbox",
99
"16位",

src/DOSBox.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Uri, workspace, window, TextDocument, FileType } from 'vscode';
1+
import { Uri, workspace, window, TextDocument } from 'vscode';
22
import { Config } from './configration';
33
import { exec, ExecOptions } from 'child_process';
44
/**
@@ -126,7 +126,6 @@ function openDosbox(opt: OPTS): Promise<string> {
126126
}
127127
window.showErrorMessage(msg);
128128
}
129-
130129
})
131130
}
132131
);

src/configration.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { workspace, window, Uri, FileSystem, FileType, ExtensionContext } from 'vscode';
1+
import { workspace, Uri, FileSystem, FileType, ExtensionContext } from 'vscode';
22
import { TextEncoder } from 'util';
33
interface ToolInfo {
44
uri: Uri,

src/runcode.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,9 @@ export class AsmAction {
6060
}
6161
if (goon && (DOSemu === "msdos player" || DOSemu === "auto")) {
6262
let flag: boolean = DOSemu === "msdos player";
63-
flag = (MASMorTASM === "masm" || runOrDebug === false || DOSemu == "auto") || flag
63+
//msdos mode: TASM debug command `TD` can only run in dosbox;(I do this inside `MSDos.RunDebug`)
64+
//auto mode: run in dosbox,`TD` in dosbox,MASM debug command `debuq` in player
65+
flag = (MASMorTASM === "MASM" && runOrDebug === false && DOSemu == "auto") || flag
6466
MSDos.RunDebug(this._config, flag, runOrDebug);
6567
};
6668
}

src/viaPlayer.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { window, Terminal, Uri, TextDocument } from 'vscode';
1+
import { window, Terminal } from 'vscode';
22
import { Config } from './configration';
33
import { exec } from 'child_process';
44
import * as DOSBox from './DOSBox';
@@ -17,6 +17,20 @@ export function runPlayer(conf: Config, filename: string): Promise<string> {
1717
}
1818
}
1919
);
20+
child.on('exit', (code) => {
21+
if (code && code !== 0) {
22+
let msg = `Use playerasm.bat Failed\t exitcode${code}\t\nFilepath: ${conf.msbatpath}`;
23+
window.showErrorMessage(msg);
24+
}
25+
});
26+
let timeout: number = 3000;
27+
setTimeout(() => {
28+
if (child.exitCode === null) {
29+
child.kill();
30+
window.showErrorMessage(`Run playerasm.bat timeout after ${timeout}ms\t\nFilepath: ${conf.msbatpath} `)
31+
}
32+
}, timeout);
33+
2034
}
2135
);
2236

0 commit comments

Comments
 (0)