阻止gulp更改shell/cmd标题名称

Nah*_*hum 9 cmd batch-file gulp

当gulp被调用时,它将我的cmd(windows)标题更改为:"gulp"

我希望窗口名称保持不变

我知道我可以使用https://www.npmjs.com/package/gulp-shell, 但这似乎是一种矫枉过正

我的意思是,如果我调用批处理脚本

title mytitle
gulp .
Run Code Online (Sandbox Code Playgroud)

窗口的标题是"gulp"而不是"mytitle"

小智 2

process.title按照本期所述使用: concat process.title 而不是 overwrite。您应该用来process.cwd()获取 gulpfile 运行的目录。

根据您的需要,在 gulpfile 中的某处写入:

process.title = process.cwd();
Run Code Online (Sandbox Code Playgroud)