Wox: 为什么用 Shell 插件启动 GUI 程序的时候会带一个命令提示符?

Created on 19 May 2016  ·  18Comments  ·  Source: Wox-launcher/Wox

输入 > notepad.exe 就会这样。而用系统自带的运行就不会这样。

这个问题让人无法用 Wox 替代 Win+R 了。

Wox 1.3.36 on Windows 10 Pro

small_changes

Most helpful comment

As the CMD plugin was going to replace Win+R so we tried (https://github.com/Wox-launcher/Wox/pull/22, https://github.com/Wox-launcher/Wox/pull/75) our best to mimic the original Win+R behaviors and make it better in the past. Unfortunately those pieces of code was removed in https://github.com/Wox-launcher/Wox/commit/7e06fd78514e0ec1cdfa9097bff83d43a7cd7e7b for fixing https://github.com/Wox-launcher/Wox/issues/88. I am not going to say you should not fix the bug, but I don't think you are fixing that correctly.

Although I acknowledge my previous mistake for referencing disassembled/leaked code, I will still blame you for making such a great change without many thoughts about existing users and backwards compatibility. This is also the reason I stopped contributing to this project.


Offtopic: Issues is not a real-time chatroom (https://github.com/Wox-launcher/Wox/issues/636#issuecomment-220216829) so please expect a delayed response.

All 18 comments

这样不好吗。。。
image

你说说你为什么要这么用。。。?

因为我设置 Wox 替代 Win+R,然后采用 Win+R 打开大部分程序……这样不行吗?

那搜索的意义何在。。。
那个是用来开命令行的。。。 ipconfig 什么的
直接用 alt+space 不好吗?
image
image

人呢。。

你说的这个办法用于启动普通的程序是很好,但一旦我需要带命令行参数启动程序的时候,就白瞎了。

而且以前 Wox 启动 ipconfig 这类程序的时候,保留命令行是直接按任意键就能关掉的,而现在是回到命令提示符,只能用鼠标关掉或者用 exit 退出。不知道这算是新 feature 还是 bug ?
如果是新 feature 的话,能不能提供一个选项关闭它呢?毕竟后续的命令提示符也不是很有必要……

这样啊 我想想

As the CMD plugin was going to replace Win+R so we tried (https://github.com/Wox-launcher/Wox/pull/22, https://github.com/Wox-launcher/Wox/pull/75) our best to mimic the original Win+R behaviors and make it better in the past. Unfortunately those pieces of code was removed in https://github.com/Wox-launcher/Wox/commit/7e06fd78514e0ec1cdfa9097bff83d43a7cd7e7b for fixing https://github.com/Wox-launcher/Wox/issues/88. I am not going to say you should not fix the bug, but I don't think you are fixing that correctly.

Although I acknowledge my previous mistake for referencing disassembled/leaked code, I will still blame you for making such a great change without many thoughts about existing users and backwards compatibility. This is also the reason I stopped contributing to this project.


Offtopic: Issues is not a real-time chatroom (https://github.com/Wox-launcher/Wox/issues/636#issuecomment-220216829) so please expect a delayed response.

@orzFly thanks for previous contribution.
ShellExecute can be set in c# by using processstartinfo, no need to use p/invoke.
I can / will add the ability back by using a combobox.

ShellExecute can be set in c# by using processstartinfo, no need to use p/invoke.

Haha! Thank you for telling me this trivial trick. Have you ever read the code, specifically, this line? Seriously, the main point for using P/Invoke to call some undocumented API is to resolve the command line.

@orzFly would you mind to tell the difference?
I asked @qianlifeng , he didn't know.
e.g. the built-in shellexecute won't work in some known special situation?

要说有什么不同倒是有蛮多不同的吧……
以前版本可以 > http://www.google.com 这样打开一个 url ……
还有 > . 就能打开用户文件夹,还有许多奇奇怪怪的命令,比如 > shell:sendto 之类的都不能用了。
而且以前也不会出现那个命令行窗口……
以前的这个插件是几乎可以取代 Win+R 的,而且用起来也很顺手。

如果真是为了修那个环境变量的 bug 的话,我觉得把这些功能都去掉会是一个比较大的损失。
在 Windows 里环境变量很多时候都需要重启的吧……而且我觉得 Wox 打开的程序继承 Wox 的环境变量实在是再正常不过的行为了。

我记一下

  • [x] uri: 网页 www.google.com
  • [x] uri: 文件目录 . \ %APPDATA% \ notepad %APPDATA%\Wox\Logs\1.2.0\2016-05-19.log
  • [x] run command gpedit.msc \ control color \ > notepad C:\Windows\System32\drivers\etc\hosts
  • [x] shell:folder shell:sendto

以上完工,还有吗?

@oott123 以上列出来的都测试过了,你看一下(执行 setup.exe ):
https://ci.appveyor.com/project/happlebao/wox/build/1.3.38/artifacts

记得勾选 run command
image

@oott123 还有更多需求的话,再提,我再写。

试过了,很厉害!谢谢!

@oott123
欢迎踊跃提需求,
提得出,写得出,
你不提,我怎写。。。

@orzFly
从贡献者那里可以看到,你是在 14 年底不写的,我是 15 年才开始写的,这跟我没什么关系吧。。。
我现在还是不知道你那份代码到底有什么区别,但至少现在楼主给的需求列表解决了。
所以你觉得这个插件还有问题的话,请另开 issue 。。。

Was this page helpful?
0 / 5 - 0 ratings