NewTab won't leave the Command Palette #10348

Closed
opened 2026-01-31 02:19:09 +00:00 by claunia · 6 comments
Owner

Originally created by @carlos-zamora on GitHub (Aug 28, 2020).

Environment

Windows build number: 10.0.19042.0
Windows Terminal version : 1.3.2382.0

Steps to reproduce

Add the following to your settings.json:

{ "name": null, "command": { "action": "newTab", "commandline": "wsl.exe" }, "keys": "f2" }

Expected behavior

This entry does not appear in the Command Palette.

Actual behavior

It appears in the Command Palette after explicitly setting "name" to null.

Originally created by @carlos-zamora on GitHub (Aug 28, 2020). # Environment ```none Windows build number: 10.0.19042.0 Windows Terminal version : 1.3.2382.0 ``` # Steps to reproduce Add the following to your settings.json: ``` { "name": null, "command": { "action": "newTab", "commandline": "wsl.exe" }, "keys": "f2" } ``` # Expected behavior This entry does not appear in the Command Palette. # Actual behavior It appears in the Command Palette after explicitly setting "name" to null.
Author
Owner

@DHowett commented on GitHub (Aug 28, 2020):

oh no, this is another instance where we need to know the difference between null and ""!

Except not in JSON. In Command.cpp:33-66

@DHowett commented on GitHub (Aug 28, 2020): _oh no_, this is another instance where we need to know the difference between `null` and `""`! Except not in JSON. In Command.cpp:33-66
Author
Owner

@ghost commented on GitHub (Oct 20, 2020):

Hi. I've tried to resolve this, yet I think it can't be since code is acting the way it is.
{ "name": null, "command": { "action": "newTab", "commandline": "wsl.exe" }, "keys": "f2" } and
{"command": {"action": "splitPane", "commandline": "wsl.exe" },"keys": "f2" } are pretty much treated as exactly same(meaning they are both null) so no matter I use something like name.isNull(), name == Json::Value::nullSingleton, and name == NULL "name": null would pass if (const auto name{ json[JsonKey(NameKey)] }) in Command.cpp line 63 and _nameFromJson() returns L"". However, I was able to "name": null to not apeear in the CommandPalette, but at same time all the commands which dose not have name key in it e.g({ "command": "scrollDown", "keys": "ctrl+shift+down" }) also disappeared from it I only got Select color scheme..., New tab..., Split pane... in the CommandPalette. All I am saying is that if there are way to differentiate
{ "name": null, "command": { "action": "newTab", "commandline": "wsl.exe" }, "keys": "f2" } and
{"command": {"action": "splitPane", "commandline": "wsl.exe" },"keys": "f2" }
this issue can be resolved. Sorry if I'm wrong.

@ghost commented on GitHub (Oct 20, 2020): Hi. I've tried to resolve this, yet I think it can't be since code is acting the way it is. `{ "name": null, "command": { "action": "newTab", "commandline": "wsl.exe" }, "keys": "f2" }` and ` {"command": {"action": "splitPane", "commandline": "wsl.exe" },"keys": "f2" }` are pretty much treated as exactly same(meaning they are both `null`) so no matter I use something like `name.isNull()`, `name == Json::Value::nullSingleton`, and `name == NULL` `"name": null` would pass `if (const auto name{ json[JsonKey(NameKey)] })` in Command.cpp line 63 and `_nameFromJson() `returns `L""`. However, I was able to `"name": null` to not apeear in the CommandPalette, but at same time all the commands which dose not have `name` key in it e.g(`{ "command": "scrollDown", "keys": "ctrl+shift+down" }`) also disappeared from it I only got Select color scheme..., New tab..., Split pane... in the CommandPalette. All I am saying is that if there are way to differentiate `{ "name": null, "command": { "action": "newTab", "commandline": "wsl.exe" }, "keys": "f2" }` and ` {"command": {"action": "splitPane", "commandline": "wsl.exe" },"keys": "f2" }` this issue can be resolved. Sorry if I'm wrong.
Author
Owner

@Don-Vito commented on GitHub (Dec 10, 2020):

@zadjii-msft, @DHowett - so this one is broken for 4 months.. and actually I am not sure when it really worked last time for commands that have action args 😊 Right now I don't see any evidence it ever worked 🤔

So.. I am not sure if it is acceptable.. but cannot we simply replace this mechanism with something more explicit and parse-able. Like adding a dedicated field (aka "hideFromPalette")? Since I am not sure we can call it breaking compatibility

@Don-Vito commented on GitHub (Dec 10, 2020): @zadjii-msft, @DHowett - so this one is broken for 4 months.. and actually I am not sure when it really worked last time for commands that have action args :blush: Right now I don't see any evidence it ever worked 🤔 So.. I am not sure if it is acceptable.. but cannot we simply replace this mechanism with something more explicit and parse-able. Like adding a dedicated field (aka "hideFromPalette")? Since I am not sure we can call it breaking compatibility
Author
Owner

@zadjii-msft commented on GitHub (Dec 11, 2020):

FYI future readers: #8402 has more investigation in it too.

Yea, I think the "name": null idea for hiding came about long before auto-generated names did, so now hiding with a null name seems weird.

I'm almost wondering how important hiding default commands is in the first place. It doesn't really seem like we've gotten requests for it. It's not like having default keybindings, where their presence might impact other apps.

That would certainly make the design easier. If we didn't need to worry about hiding defaults, we could focus on just hiding commands defined by the user.

@zadjii-msft commented on GitHub (Dec 11, 2020): FYI future readers: #8402 has more investigation in it too. Yea, I think the `"name": null` idea for hiding came about long before auto-generated names did, so now hiding with a null name seems weird. I'm almost wondering how important **hiding default commands** is in the first place. It doesn't really seem like we've gotten requests for it. It's not like having default keybindings, where their presence might impact other apps. That would certainly make the design easier. If we didn't need to worry about hiding defaults, we could focus on just hiding commands defined by the user.
Author
Owner

@atimholt commented on GitHub (Dec 13, 2020):

For what it's worth, I'm always for as much customizability as possible. The presence of commands that one has long decided they're never going to use creates a measure of noise and, worse, can often hinder "fluent" use by necessitating more keystrokes for the fuzzy-find search.

@atimholt commented on GitHub (Dec 13, 2020): For what it's worth, I'm always for as much customizability as possible. The presence of commands that one has long decided they're never going to use creates a measure of noise and, worse, can often hinder "fluent" use by necessitating more keystrokes for the fuzzy-find search.
Author
Owner

@ghost commented on GitHub (May 25, 2021):

:tada:This issue was addressed in #9621, which has now been successfully released as Windows Terminal Preview v1.9.1445.0.🎉

Handy links:

@ghost commented on GitHub (May 25, 2021): :tada:This issue was addressed in #9621, which has now been successfully released as `Windows Terminal Preview v1.9.1445.0`.:tada: Handy links: * [Release Notes](https://github.com/microsoft/terminal/releases/tag/v1.9.1445.0) * [Store Download](https://www.microsoft.com/store/apps/9n8g5rfz9xk3?cid=storebadge&ocid=badge)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#10348