fx version: 39.2.0
Background
The TUI dig expression bar (.) seems to only evaluates a single JS expression against the root, not allow array syntactic sugar.
For simple navigation this works, but mapping over array elements requires either .map() syntax or the @ prefix — both of which are unusable interactively due to auto-revert on intermediate invalid states? Trying to type .folders[]. in the TUI bar is automatically fixed to .folders.
Here's what works in the CLI, which I want to run from one fx TUI invocation:
# Multi-arg chaining
fx /tmp/a.json .folders '@.path'
# Pipe chaining
cat /tmp/a.json | fx .folders | fx '@.path'
# prop[] syntactic sugar
fx /tmp/a.json '.folders[].path'
All produce ["foo", "bar", "baz"]. The TUI has no equivalent?
Repro file /tmp/a.json:
{
"folders": [
{ "path": "foo" },
{ "path": "bar" },
{ "path": "baz" }
]
}
Requested behavior
Something like:
- The TUI expression bar accepts multiple space-separated expressions (mirroring CLI multi-arg), e.g.
.folders @.path
- After
. dig command, allow setting a new root, allowing a follow-up expression in a fresh bar
@.path is accepted as a valid TUI expression when the current result is an array
- Or just document at https://fx.wtf that the TUI isn't the right tool for this?
fx version: 39.2.0
Background
The TUI dig expression bar (
.) seems to only evaluates a single JS expression against the root, not allow array syntactic sugar.For simple navigation this works, but mapping over array elements requires either
.map()syntax or the@prefix — both of which are unusable interactively due to auto-revert on intermediate invalid states? Trying to type.folders[].in the TUI bar is automatically fixed to.folders.Here's what works in the CLI, which I want to run from one
fxTUI invocation:All produce
["foo", "bar", "baz"]. The TUI has no equivalent?Repro file
/tmp/a.json:{ "folders": [ { "path": "foo" }, { "path": "bar" }, { "path": "baz" } ] }Requested behavior
Something like:
.folders @.path.dig command, allow setting a new root, allowing a follow-up expression in a fresh bar@.pathis accepted as a valid TUI expression when the current result is an array