阻止 gulp 更改 shell/cmd 标题名称 [英] stop gulp from changing shell/cmd title name

查看:14
本文介绍了阻止 gulp 更改 shell/cmd 标题名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

When gulp is called the it changes my cmd (windows) title to: "gulp"

我希望窗口名称保持原样

I want the window name to stay as it was

我知道我可以使用 https://www.npmjs.com/package/gulp-shell但这似乎有点过头了

I know I can use https://www.npmjs.com/package/gulp-shell but this seems like an overkill

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

I mean that if I call batch script

title mytitle
gulp .

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

the window's title is "gulp" and not "mytitle"

推荐答案

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

Use process.title as stated in this issue : concat process.title instead of overwrite. You shoud use process.cwd() to get the directory where the gulpfile is running.

在你的 gulpfile 的某个地方,根据你的需要,写:

somewhere in your gulpfile, according to your need, write:

process.title = process.cwd();

这篇关于阻止 gulp 更改 shell/cmd 标题名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆