【问题标题】:VSCode integrated terminal argument: current filenameVSCode 集成终端参数:当前文件名
【发布时间】:2018-10-21 01:38:59
【问题描述】:

在 VSCode 中,我想将当前文件名传递给集成终端 有一个设置:

"terminal.integrated.shell.windows": "C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\powershell.exe",

如何添加当前文件名,例如这会很棒:

"terminal.integrated.shell.windows": "C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\powershell.exe %CurrentFileName%",

谢谢。

【问题讨论】:

标签: shell terminal visual-studio-code


【解决方案1】:

shell argument 将位于 terminal.integrated.shellArgs.powershell

按实际值尝试使用variables which should be substituted 之一

"terminal.integrated.shellArgs.powershell": ["${file}"]

【讨论】:

  • 我试过了,但它对我不起作用。正如您引用的文档所述:“VS Code 支持 tasks.json 文件中的字符串内的变量替换”;这似乎不适用于 shellArgs。我错过了什么吗?
  • @FrankMonroe 您并没有错过太多,除了项目中请求变量替换的问题在 shellArgs 中发生;)
  • 谢谢 - 很想知道这个问题,所以我可以投票。
猜你喜欢
  • 2017-06-01
  • 1970-01-01
  • 1970-01-01
  • 2021-11-01
  • 1970-01-01
  • 2019-06-12
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多