Currently you see all logs with folder switching when you start a terminal, maybe it will be better to clear screen after initialization (in addition, this currently working directory is visible in prompt).
Command clear is suitable for almost all consoles (?), and only cmd uses cls.
I am unfamiliar with JS :) And did this as follows:
var clearCommand = "clear"; // <--- Here
var dir = path.dirname(uri.fsPath);
var terminal = vscode.window.createTerminal();
terminal.show(false);
switch (kindOfShell(vscode.workspace.getConfiguration('terminal'))) {
case "wslbash":
// c:\workspace\foo to /mnt/c/workspace/foo
dir = dir.replace(/(\w):/, '/mnt/$1').replace(/\\/g, '/');
break;
case "cmd":
// send 1st two characters (drive letter and colon) to the terminal
// so that drive letter is updated before running cd
clearCommand = "cls"; // <--- Here
terminal.sendText(dir.slice(0, 2));
}
terminal.sendText("cd \"" + dir + "\"");
terminal.sendText(clearCommand); // <--- Here
Currently you see all logs with folder switching when you start a terminal, maybe it will be better to clear screen after initialization (in addition, this currently working directory is visible in prompt). Command
clear
is suitable for almost all consoles (?), and only cmd usescls
.I am unfamiliar with JS :) And did this as follows:
I can open a PR if this seems reasonable for you.