Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

watch doesn't work as described #7362

Closed
solodov opened this issue Dec 6, 2022 · 2 comments · Fixed by #7374
Closed

watch doesn't work as described #7362

solodov opened this issue Dec 6, 2022 · 2 comments · Fixed by #7374
Milestone

Comments

@solodov
Copy link
Contributor

solodov commented Dec 6, 2022

Describe the bug

Split of closures and blocks in 0.72 might have broken some built-in commands, watch in particular. Either that, or the documentation is out of date.

How to reproduce

  1. run watch . { |op, path, new_path| $"($op) ($path) ($new_path)"}

Expected behavior

Should watch for file changes and log

Screenshots

〉watch . { |op, path, new_path| $"($op) ($path) ($new_path)"} 
Error: nu::parser::parse_mismatch (link)

  × Parse mismatch during operation.
   ╭─[entry #21:1:1]
 1 │ watch . { |op, path, new_path| $"($op) ($path) ($new_path)"}
   ·           ┬
   ·           ╰── expected block but found closure
   ╰────

Configuration

key value
version 0.72.1
branch
commit_hash
build_os macos-aarch64
build_target aarch64-apple-darwin
rust_version rustc 1.65.0
cargo_version cargo 1.65.0 (4bc8f24d3 2022-10-20)
pkg_version 0.72.1
build_time 2022-12-05 17:17:06 +00:00
build_rust_channel release
features database, default, trash, which, zip
installed_plugins

Additional context

No response

@rgwood
Copy link
Contributor

rgwood commented Dec 6, 2022

Thanks for the bug report. I’ll take a look, should be an easy fix.

rgwood added a commit that referenced this issue Dec 7, 2022
The block+closure split broke `watch` for some use cases. Fixed.

We should eventually add some tests for `watch` but it's a little tricky
since it's an interactive command.

Closes #7362.
@rgwood
Copy link
Contributor

rgwood commented Dec 7, 2022

This is fixed in main now if you can build Nu from source. Otherwise the fix will come out in the v0.73 release on Dec 20. Sorry for the inconvenience!

@hustcer hustcer added this to the v0.73 milestone Dec 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants