Add issues #16–#23
#16 multiline shell commands #17 _ scope (global vs local) #18 path expansion (~) #19 nested commands trigger prompt2 #20 simplify backtick return value #21 prompt redesign #22 implicit interactive commands (drop ! prefix) #23 general cleanup and refactor
This commit is contained in:
30
issues/20-backtick-return-value.md
Normal file
30
issues/20-backtick-return-value.md
Normal file
@@ -0,0 +1,30 @@
|
||||
# 20 — Simplify backtick return value
|
||||
|
||||
**Status:** open
|
||||
|
||||
Currently backtick expressions return a table `{code, stdout, stderr}`, requiring verbose access:
|
||||
|
||||
```lua
|
||||
!echo ${`ls`.stdout}
|
||||
```
|
||||
|
||||
This is explicit but noisy for the common case. Consider making backticks return stdout directly, with the full result table still available via `_`:
|
||||
|
||||
```lua
|
||||
-- backtick returns stdout string directly
|
||||
local files = `ls`
|
||||
|
||||
-- full result still available in _
|
||||
print(_.code)
|
||||
print(_.stderr)
|
||||
```
|
||||
|
||||
## Considerations
|
||||
|
||||
- This would be a breaking change to current backtick semantics
|
||||
- The table is still useful when you need exit code or stderr
|
||||
- Could we return multiple values? `stdout, result_table = \`cmd\``
|
||||
- How does this interact with pipelines where you chain results?
|
||||
|
||||
- This would unify the interface/behaviour of backticks and ! commands, both set the majority of their data to `_`
|
||||
- Main difference is where do they output their stdout & stderr
|
||||
Reference in New Issue
Block a user