nyagos
nyagos copied to clipboard
`start` command completion only work executable item
https://github.com/nyaosorg/nyagos/blob/ae9f3228e6652a1332ec66742f9fd8963ee6452e/completion/completion.go#L86
Currently naygos built-in start
has "completion" that completing arguments only executable file.
But windows cmd start
supported below these:
- start "exec" , then open new window and execute "exec" (Win32GUI app directly start, CLI item run as new cmd) - now support
- start "file", then open "file" with system file handler.
- start "dir", then open "dir" explorer and other (directory handler)
Nyagos start
manually set and open file/dir OK, work fine.
Suggestion:
Support both document and directory add to start
completion.
OK. I understand it should complete to any file on the %PATH%. It requires an new completion function.
Memo for myself
-
start book1.xlsx
in CMD.EXE can openbook1.xlsx
on the %PATH% even although the suffix.xlsx
does not exist in the %PATHEXT%.
Implemented ! 実装しました
- commit 953b3cb
- snapshot for amd64
- snapshot for 386
When the base string user input does not contains / or \ , the shell searches all filenames on the directories listed %PATH%. 元文字列が / や \ を含んでなければ、%PATH% に含まれる全ファイルを検索します。
The change will be included in the next binary release. 次のバイナリリリースに含められる予定です。
@tsuyoshicho
Basically it work is good. 基本問題ないと思います。
(PATHの設定如何で微妙なアイテムも出てしまいますが、それはまあユーザー責でしょうし)
長くなるので、もう全部日本語で書いちゃいますが、CMD.EXE 互換の start の仕様的に「補完しすぎ」だったようです。
START ["タイトル"] [/D パス] [/I] [/MIN] [/MAX] [/SEPARATE | /SHARED]
[/LOW | /NORMAL | /HIGH | /REALTIME | /ABOVENORMAL | /BELOWNORMAL]
[/NODE <NUMA ノード>] [/AFFINITY <16 進数の関係マスク>] [/WAIT] [/B]
[コマンド/プログラム] [パラメーター]
[パラメーター]
部分の補完まで「%PATH% に含まれる全ファイルを検索」をやってしまっていたのですが、こここは「普通のファイル名補完」にとどめておくべきでした。%PATH% を検索するのは [コマンド/プログラム]
の部分のみにすべきでした。このあたり、そのうち直します。
また、nyagos の start は Lua 関数で実装していたのですが、Lua で実装しているコマンドに対して、Goコードで補完していました(これは前からそうだった)。これはアンバランスなので、そのうち start コマンドもGo化するかもしれません。