Commit Graph

873 Commits

Author SHA1 Message Date
Per Bothner
beec658872
New "display_output" hook. (#6915)
* New "display_output" hook.

* Fix unrelated "clippy" complaint in nu-tables crate.

* Fix code-formattng and style issues in "display_output" hook

* Enhance eval_hook to return PipelineData.

This allows a hook (including display_output) to return a value.

Co-authored-by: JT <547158+jntrnr@users.noreply.github.com>
2022-11-06 13:46:40 +13:00
Alex Saveau
be5d71ea47
Run a round of clippy --fix to fix a ton of lints (#7006)
Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>

Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>
2022-11-04 15:11:17 -05:00
Stefan Holderbach
ce4ae00a6f
Remove unused dependencies (#6945)
* Remove unused dependencies

Inspired by #6938 ran `cargo +nightly udeps --features extra`.
Removes 2 crates and should remove an unnecessary intra-workspace
dependency which might open up further opportunities for compilation.

* Make windows-only dependency conditional in toml

`omnipath` is only used on Windows and already behind a `#[cfg]` block
in the code. Made the dependency in `Cargo.toml` conditional as well.

* Make `nu-pretty-hex` example a proper example

This allows making `rand` a dev-dependency in this crate.
2022-10-29 21:19:12 +02:00
WindSoilder
4f7f6a2932
Friendly error message for access beyond end (#6944)
Adds `ShellError::AccessEmptyContent`
2022-10-29 19:47:50 +02:00
Leon
5add5cbd12
Further edits to help messages (#6913) 2022-10-26 09:36:42 -07:00
Reilly Wood
e0cc2c9112
Make get 1 error message better (#6892) 2022-10-24 18:22:57 -07:00
Stefan Holderbach
92ab8b831b
Reduce required dependencies for diagnostics (#6648)
Disable backtrace on miette
- gimli crate requires several seconds
Disable diagnostics on wax
- depends on an outdated miette version

Builds fine, no observable loss in diagnostics quality of life

Removes 10 crates that have to be compiled.
2022-10-24 21:42:32 +02:00
nibon7
ebca840d91
Add support to render right prompt on last line of the prompt (#6781)
* Add support to render right prompt on last line of the prompt

* reset reedline to main branch

* update reedline to fix right prompt to be rendered correctly

* reset reedline to main branch again
2022-10-23 16:18:26 +02:00
Reilly Wood
17b2bcc125
Support range in str substring (#6867) 2022-10-23 11:42:17 +02:00
Access
c9fb381d69
feat: coredump (#6791)
fix issue in https://github.com/nushell/nushell/issues/5903
return Error to pipeline_data, if match error, then return error
directly
2022-10-22 20:24:58 +02:00
pwygab
3f555a6836
add more helpful error for calling a decl that exists in a module (#6752)
* add more helpful error for calling a decl that exists in a module

* accord to suggestions

* make error more helpful
2022-10-22 11:41:31 -05:00
pwygab
5e748ae8fc
make ++ append lists (#6766)
* make `++` append lists

* fmt

* fix for database
2022-10-20 23:28:18 +13:00
Dan Davison
50e53e788a
Simplify and reduce allocations in pipeline data loop (#6790) 2022-10-20 23:22:07 +13:00
Darren Schroeder
a724a8fe7d
bump to dev version 0.70.1 (#6814) 2022-10-20 18:04:10 +13:00
JT
9ef65dcd69
Bump to 0.70 (#6800) 2022-10-19 07:13:36 +13:00
WindSoilder
a498234f1d
fix stdout hangged on (#6715) 2022-10-15 14:29:29 -05:00
WindSoilder
5815f122ed
avoid freeze when capturing external stderr (#6700)
* avoid freeze when capturing external stderr

* try replace from sh to bash

* change description

* fmt code
2022-10-12 08:41:20 -05:00
WindSoilder
1998bce19f
avoid freeze for table print (#6688)
* avoid freeze for table print

* make failed_with_proper_exit_code work again

* add test case for table

* fix un-used import on windows
2022-10-10 07:32:55 -05:00
Brian Myers
fde56cfe99
upgrade num-format (#6694) 2022-10-10 06:25:57 -05:00
unrelentingtech
4af0a6a3fa
Foreground process group management, again (#6584)
* Revert "Revert "Try again: in unix like system, set foreground process while running external command (#6273)" (#6542)"

This reverts commit 2bb367f570.

* Make foreground job control hopefully work correctly

These changes are mostly inspired by the glibc manual.

* Fix typo in external command description

* Only restore tty control to shell when no fg procs are left; reuse pgrp

* Rework terminal acquirement code to be like fish

Co-authored-by: Darren Schroeder <343840+fdncred@users.noreply.github.com>
2022-09-29 13:37:48 -05:00
pwygab
f5e1b08e6a
ensure Operator::And errors out with incompatible types (#6638) 2022-09-29 06:17:21 -05:00
Darren Schroeder
dd578926c3
add some float operations with filesize (#6618)
* add some float operations with filesize

* more changes

* update return values on filesize-filesize, duration-duration

* missed filesize in floordiv

* missed float * duration
2022-09-28 17:07:50 -05:00
Nano
5c99921e15
Table indexes (#6620)
* Table indexes

* Renamed to `show_table_indexes`

* Renamed to `table_index_mode`
2022-09-28 17:07:33 -05:00
Darren Schroeder
23bba9935f
bump to dev version 0.69.2 (#6635) 2022-09-28 17:06:21 -05:00
JT
8a5abc7afc
bump to 0.69.1 (#6631) 2022-09-28 15:48:01 +13:00
JT
3beaca0d06
bump to 0.69 (#6623) 2022-09-28 07:14:31 +13:00
JT
d66a5398d1
Remove month and year duration constants (#6613)
remove month/year/decade durations for parsing and units, but leave the humanized output for viewing
2022-09-26 09:55:13 +13:00
WindSoilder
b47bd22b37
Removes export env command (#6468)
* remove export_env command

* remove several export env usage in test code

* adjust hiding relative test case

* fix clippy

* adjust tests

* update tests

* unignore these tests to expose ut failed

* using `use` instead of `overlay use` in some tests

* Revert "using `use` instead of `overlay use` in some tests"

This reverts commit 2ae24b24c3.

* Revert "adjust hiding relative test case"

This reverts commit 4369af6d05.

* Bring back module example

* Revert "update tests"

This reverts commit 6ae94ef513.

* Fix tests

* "Fix" a test

* Remove remaining deprecated env functionality

* Re-enable environment hiding for `hide`

To not break virtualenv since the overlay update is not merged yet

* Fix hiding env in `hide` and ignore some tests

Co-authored-by: kubouch <kubouch@gmail.com>
2022-09-25 19:52:43 +03:00
Dan Davison
ad0c6bf7d5
Improve "Did you mean?" suggestions (#6579)
* Copy lev_distance.rs from the rust compiler

* Minor changes to code from rust compiler

* "Did you mean" suggestions: test instrumented to generate markdown report

* Did you mean suggestions: delete test instrumentation

* Fix tests

* Fix test

`foo` has a genuine match: `for`

* Improve tests
2022-09-20 19:46:01 -05:00
Darren Schroeder
0b9dd87ca8
add history session id to $nu (#6585)
* add history session id to $nu

* get nushell to compile

* update test
2022-09-19 09:28:36 -05:00
Justin Ma
4490e97a13
Bump dev version to v0.68.2 (#6538) 2022-09-12 08:29:39 +12:00
Dan Davison
367f79cb4f
Don't compute 'did you mean' suggestions unless showing them to user (#6540) 2022-09-11 09:58:19 -07:00
unrelentingtech
9ee4086dfa
Add a 'commandline' command for manipulating the current buffer (#6492)
* Add a 'commandline' command for manipulating the current buffer

from `executehostcommand` keybindings. Inspired by fish:
https://fishshell.com/docs/current/cmds/commandline.html

* Update to development reedline

Includes nushell/reedline#472

Co-authored-by: sholderbach <sholderbach@users.noreply.github.com>
2022-09-09 15:31:32 -05:00
WindSoilder
aa92141ad7
Remove --encoding argument during register plugin (#6486)
* first implement new plugin protocol core logic

* fix debug body construct

* fix output message from plugin

* finish plugin commands calling

* fix tests and adjust plugin_custom_value call

* fmt code

* fmt code, fix clippy

* add FIXME comment

* change from FIXME to TODO
2022-09-07 09:07:42 -05:00
Justin Ma
c902d8bc0c
bump dev version to v0.68.1 (#6504) 2022-09-07 14:27:33 +12:00
JT
9273bb3f72
bump to 0.68 (#6501) 2022-09-07 06:29:01 +12:00
JT
d86350af80
Revert "Make $ on variable names optional (#6434)" (#6446)
This reverts commit 3cb9147f22.
2022-09-06 05:42:47 +12:00
Jakub Žádník
65327e0e7e
Disable cyclical module imports (#6477) 2022-09-04 23:19:20 +03:00
Jakub Žádník
3ed3712fdc
Fix overlays not preserving hidden env vars (#6475)
* Fix overlays not preserving hidden env vars

* Add a few more test

* Add one more test of resetting hidden env vars

* Move removed source-env tests
2022-09-04 20:32:06 +03:00
Jakub Žádník
f46962d236
Fix scoped overlay use not finding a module (#6474)
* Add source-env test for dynamic path

* Use correct module ID for env overlay imports

* Remove parser check from "overlay list"

It would cause unnecessary errors from some inner scope if some
overlay module was also defined in some inner scope.

* Restore Cargo.lock back

* Remove comments
2022-09-04 18:36:42 +03:00
pwygab
e81689f2c0
Allow for rejecting nested record cells (#6463)
* add new function to remove data at a cellpath; allow reject to use cellpath

* add tests

* fmt

* fix clippt

* get it working properly with lists of records

* fix clippy, hopefully

* fix clippy, hopefully 2
2022-09-03 07:35:36 -05:00
WindSoilder
fbe9d6f529
Highlight source value as well as failure point. (#6442)
* show multiple errors at once for some commands

* change from invalid item to source value
2022-09-01 12:20:22 +02:00
Darren Schroeder
4858a9a817
Revert "Add support for optional list stream output formatting (#6325)" (#6454)
This reverts commit ec4e3a6d5c.
2022-08-31 18:09:40 -05:00
JT
c52d45cb97
Move from source to source-env (#6277)
* start working on source-env

* WIP

* Get most tests working, still one to go

* Fix file-relative paths; Report parser error

* Fix merge conflicts; Restore source as deprecated

* Tests: Use source-env; Remove redundant tests

* Fmt

* Respect hidden env vars

* Fix file-relative eval for source-env

* Add file-relative eval to "overlay use"

* Use FILE_PWD only in source-env and "overlay use"

* Ignore new tests for now

This will be another issue

* Throw an error if setting FILE_PWD manually

* Fix source-related test failures

* Fix nu-check to respect FILE_PWD

* Fix corrupted spans in source-env shell errors

* Fix up some references to old source

* Remove deprecation message

* Re-introduce deleted tests

Co-authored-by: kubouch <kubouch@gmail.com>
2022-09-01 08:32:56 +12:00
JT
3cb9147f22
Make $ on variable names optional (#6434)
* DRAFT: make var dollar optional

* couple fixes

* fix some tests + cleanup
2022-08-29 14:35:55 +12:00
WindSoilder
f1e7a01b2e
shows wrong item when each command runs to failed. (#6437)
* add --wrong-item for each command

* fix test

* show multiple errors at once
2022-08-28 11:40:14 +03:00
Jakub Žádník
34d7c17e78
Bring module's environment when activating overlay (#6425) 2022-08-27 01:32:19 +03:00
Reilly Wood
ef26d539a7
Make cp errors more specific (#6396) 2022-08-23 21:32:41 -07:00
Herlon Aguiar
646aace05b
feat: external completions for commands/flags (#6295)
* wip

* wip

* cleanup

* error message

* cleanup

* cleanup

* fix clippy

* add test

* fix span

* cleanup

* cleanup

* cleanup

* fixed completion

* push char

* wip

* small fixes

* fix remove last span

* fmt

* cleanup

* fixes + more tests

* fix test

* only complete for commands

* also complete flags

* change decl_id to block_id

* use nu completion first

* fix test

* ignore test

* update config section
2022-08-22 21:38:51 +03:00
nibon7
772ad896c8
Get $nu.config-path and $nu.env-path from EngineState (#6366)
* Get `$nu.config-path` and `$nu.env-path` from `EngineState`

Signed-off-by: nibon7 <nibon7@163.com>

* replace tuple with hashmap

Signed-off-by: nibon7 <nibon7@163.com>

* refactor set_config_path

Signed-off-by: nibon7 <nibon7@163.com>

Signed-off-by: nibon7 <nibon7@163.com>
2022-08-22 19:30:09 +03:00