Debug mode for scripts
Open
Nobody has claimed this yet.
category:enhancement
status:needs-design
- Dominant language
- Rust
- Stars
- 40.5k
- Forks
- 2.3k
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 85
Description
Discussed in https://github.com/nushell/nushell/discussions/4530
Originally posted by cypof February 18, 2022
What would be the best way to run nu scripts in debug mode? E.g. bash can run scripts with settings like this:
# stop and show the stack on any error
set -eE -o functrace
# error on unset variables
set -u
# print each command before executing it
set -x
# extend "set -x" above with source file, line number, function name etc
export PS4='+(${BASH_SOURCE:-""}:${LINENO}) ${FUNCNAME[0]:+${FUNCNAME[0]}(): }'
```</div>
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked discussion at https://github.com/nushell/nushell/discussions/4530 to understand the proposed debug-mode scope. Define what “done” means for script error handling, unset variables, command tracing, and source-location or function context before identifying the relevant Nushell entry points and tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust, shell
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100