Commit Graph

1068 Commits

Author SHA1 Message Date
nibon7
0b429fde24
Log warning message if nu failed to sync history (#6106)
Fixes #6088

Signed-off-by: nibon7 <nibon7@163.com>
2022-07-23 11:35:43 -05:00
Darren Schroeder
98126e2981
add more shell integration ansi escapes in support of vscode (#6087)
* add more shell integration ansi escapes in support of vscode

* clippy
2022-07-20 15:03:29 -05:00
pwygab
ae765c71fd
add config option to limit external command completions (#6076)
* add config option to limit external command completions

* fmt

* small change

* change name in config

* change name in config again
2022-07-19 12:39:50 -05:00
Mathspy
9aabafeb41
Add plugin CLI argument (#6064)
* Add plugin CLI argument

While working on supporting CustomValues in Plugins I stumbled upon the
test utilities defined in [nu-test-support][nu-test-support]
and thought these will come in handy, but they end up being outdated.
They haven't been used or since engine-q's was merged, so they are
currently using the old way engine-q handled plugins, where it would
just look into a specific folder for plugins and call them without
signatures or registration. While fixing that I realized that there is
currently no way to tell nushell to load and save signatures into a
specific path, and so those integration tests could end up potentially
conflicting with each other and with the local plugins the person
running them is using.

So this adds a new CLI argument to specify where to store and load
plugin signatures from

I am not super sure of the way I implemented this, mainly
I was a bit confused about the distinction between
[src/config_files.rs][src/config_files.rs] and
[crates/nu-cli/src/config_files.rs][crates/nu-cli/src/config_files.rs].
Should I be moving the plugin loading function from the `nu-cli` one to
the root one?

[nu-test-support]: 9d0be7d96f/crates/nu-test-support/src/macros.rs (L106)
[src/config_files.rs]: 9d0be7d96f/src/config_files.rs
[crates/nu-cli/src/config_files.rs]: 9d0be7d96f/crates/nu-cli/src/config_files.rs

* Gate new CLI option behind plugin feature

* Rename option to plugin-config
2022-07-17 13:29:19 -05:00
Jack Clayton
9ced5915ff
Fix short-flag completion (#6067) 2022-07-17 07:46:40 -05:00
Reilly Wood
5cc6505512
Handle Windows drive paths in auto-cd (#6051)
* Handle Windows drive paths in auto-cd

* Limit `use regex` to Windows

* Use lazy_static for Windows drive path regex

* try fixing Clippy on *nix
2022-07-15 19:01:38 -07:00
Jakub Žádník
26f31da711
Split merging of parser delta and stack environment (#6005)
* Remove comment

* Split delta and environment merging

* Move table mode to a more logical place

* Cleanup

* Merge environment after reading default_env.nu

* Fmt
2022-07-14 17:09:27 +03:00
pwygab
b9bbf0c10f
make auto-cd change $env.OLDPWD (#6019)
* make auto-cd change `$env.OLDPWD`

* fmt

* use Config

* make auto-cd change `.OLDPWD`
2022-07-12 06:05:19 -05:00
JT
a5470b2362
use simpler reedline (#6016) 2022-07-12 13:25:31 +12:00
Darren Schroeder
c1bf9fd897
fixes ansi escape leakage from ill-behaved externals, again! (#6012)
* this fixes ansi escape leakage from ill-behaved externals

* cross-platform fix
2022-07-11 16:01:49 -05:00
Jakub Žádník
3676a8a48d
Expand Hooks Functionality (#5982)
* (WIP) Initial messy support for hooks as strings

* Cleanup after running condition & hook code

Also, remove prints

* Move env hooks eval into its own function

* Add env change hooks to simulator

* Fix hooks simulator not running env hooks properly

* Add missing hooks test file

* Expand hooks tests

* Add blocks as env hooks; Preserve hook environment

* Add full eval to pre prompt/exec hooks; Fix panic

* Rename env change hook back to orig. name

* Print err on test failure; Add list of hooks test

* Consolidate condition block; Fix panic; Misc

* CHange test to use real file

* Remove unused stuff

* Fix potential panics; Clean up errors

* Remove commented unused code

* Clippy: Fix extra references

* Add back support for old-style hooks

* Reorder functions; Fmt

* Fix test on Windows

* Add more test cases; Simplify some error reporting

* Add more tests for setting correct before/after

* Move pre_prompt hook to the beginning

Since we don't have a prompt or blocking on user input, all hooks just
follow after each other.
2022-07-10 13:45:46 +03:00
默可思
221f36ca65
Add --directory (-D) flag to ls, list the directory itself instead of its contents (#5970)
* Avoid extending the directory without globs in `nu_engine::glob_from`

* avoid joining a `*` to the directory without globs

* remove checks on directory permission and whether it is empty

The previous implemention of `nu_engine::glob_from` will extend the
given directory even if it containes no glob pattern. This commit
overcomes lack of consistency with the function `nu_glob::glob`.

* Add flag -D to ls, to list the directory itself instead of its contents

* add --directory (-d) flag to ls

* correct the difference between the given path and the cwd

* set default path to `.` instead of `./*` when --directory (-d) flag is true

* add comments

* add an example

* add tests

* fmt
2022-07-08 14:15:34 -05:00
Justin Ma
de162c9aea
Bump to 0.65.1 dev version (#5962) 2022-07-06 16:25:09 +12:00
Stefan Holderbach
89acbda877
Pin reedline to new 0.8.0 release (#5954)
For the nushell 0.65.0 release

https://github.com/nushell/reedline/releases/tag/v0.8.0
2022-07-05 21:25:35 +12:00
JT
0d40d0438f
bump to 0.65 (#5952) 2022-07-05 17:54:16 +12:00
WindSoilder
84caf8859f
add -e flag to print, to print the value to stderr (#5935)
* Refactor: make stdout write all and flush as generic function

* support print to stderr
2022-07-02 09:54:49 -05:00
Michael Angerman
58fa2e51a2
update crate thiserror to version 1.0.31 in crates nu-cli, nu-command, nu-parser, nu-protocol (#5919) 2022-06-30 13:55:01 -07:00
Benoît Cortier
1c15a4ed3a
docs: clarify print and echo commands (#5909)
I thought this comment was relevant:
https://github.com/nushell/nushell/issues/5724#issuecomment-1148164153
2022-06-29 18:43:46 -04:00
Benoît Cortier
228ede18cf
build: update miette dependency (#5889) 2022-06-26 07:03:38 -05:00
JT
575ddbd4ef
Clippy and remove unused is_binary (#5879) 2022-06-26 08:20:28 +12:00
JT
533e04a60a
Bump to 0.64.1 dev version (#5865) 2022-06-24 16:47:00 +12:00
Darren Schroeder
0827ed143d
cleanup $config as a built-in (#5852) 2022-06-22 13:13:03 -05:00
Darren Schroeder
128ce6f9b7
update reedline config based on recent reedline changes (#5845) 2022-06-21 12:22:11 -05:00
WindSoilder
fab3f8fd40
fix exit code (#5835)
* fix exit code

* fix usage

* add comment
2022-06-20 09:05:11 -05:00
Kangaxx-0
08aa248c42
Add more tests for completion (#5826)
* Add more tests for completion

* Fix windows

* Cleanup
2022-06-18 19:42:00 -05:00
Kangaxx-0
5f0ad1d6ad
Fix alias completion crash (#5814)
* Solve crash - commit 1

* commit 2 with issue

* Fix corner case

* Unit tests

* Fix windows tests
2022-06-17 07:50:10 -05:00
pwygab
8d7bb9147e
Attempts to fix file completions for open, rm and ls (and other filesystem commands) (#5805)
* fixes the issue for 'open' and other commands that explicitly use `SyntaxShape::Filepath`

* fixes for `rm` and similar commands

* fixes for `ls`: potentially breaking?

* fmt

* a curious fix to the test

* a curious fix to the test, except for Windows this time

* fixes Windows tests failing

* resolves it by putting an explicit check for `ls`

* reverts unnecessary test changes; fmt

* changes the order of completion operations
2022-06-17 07:47:43 -05:00
JT
d1c719a8cc
bump to 0.64 (#5777)
Co-authored-by: sholderbach <sholderbach@users.noreply.github.com>
2022-06-15 14:39:17 +12:00
Stefan Holderbach
fe88d58b1e
Pin reedline v0.7.0 for the nushell v0.64.0 release (#5781)
Includes the new History API and sqlite history backend

Release notes: https://github.com/nushell/reedline/releases/tag/v0.7.0
2022-06-14 23:21:14 +02:00
phiresky
42dbfd1fa0
SQLite History MVP with timestamp, duration, working directory, exit status metadata (#5721)
This PR adds support for an SQLite history via nushell/reedline#401

The SQLite history is enabled by setting history_file_format: "sqlite" in config.nu.

* somewhat working sqlite history
* Hook up history command
* Fix error in SQlitebacked with empty lines

When entering an empty line there previously was the "No command run"
error with `SqliteBackedHistory` during addition of the metadata

May be considered a temporary fix

Co-authored-by: sholderbach <sholderbach@users.noreply.github.com>
2022-06-14 22:53:33 +02:00
Kangaxx-0
534e1fc3ce
Add NU config to allow user be able to turn off external completion (#5773)
* 06-07-wsl

* 06-07-linux-issue-with-delete-input

* 06-08-2023

* 06-08-Linux

* commit for merge

* Fix unit test

* format

* clean code

* Add flag to turn off external completion

* change env var to config

* Fix comment

Co-authored-by: Frank Zhang <v-frankz@microsoft.com>
2022-06-14 14:28:11 -05:00
Fernando Herrera
11d7d8ea1e
Remove dfr from dataframe commands (#5760)
* input and output tests

* input and output types for dfr

* expression converter

* remove deprecated command

* correct expressions

* cargo clippy

* identifier for ls

* cargo clippy

* type for head and tail expression

* modify full cell path if block
2022-06-12 14:18:00 -05:00
WindSoilder
c5cb369d8d
While starting nu, force PWD to be current working directory (#5751)
* fix current working directory during start

* fix tests

* always set PWD to current_dir
2022-06-10 13:01:08 -05:00
Kangaxx-0
b6959197bf
Support completion for alias and sub-command (#5749)
* 06-07-wsl

* 06-07-linux-issue-with-delete-input

* 06-08-2023

* 06-08-Linux

* commit for merge

* Fix unit test

* format

* clean code

Co-authored-by: Frank Zhang <v-frankz@microsoft.com>
2022-06-10 12:59:15 -05:00
Fernando Herrera
d5b99ae316
input and output types (#5750)
* input and output types

* added description

* type from stored variable

* string in custom value

* more tests with non custom
2022-06-10 10:59:35 -05:00
WindSoilder
2e0b964d5b
handle SIGQUIT (#5744)
* handle sigquit

* fix clippy
2022-06-09 07:08:15 -05:00
Justin Ma
64efa30f3e
fix: normalize some parameter names (#5725) 2022-06-06 09:42:13 -05:00
Jae-Heon Ji
820a6bfb08
feat: add search terms to category of strings (#5723) 2022-06-06 08:47:09 -05:00
sec65
3c421c5726
Added loginshell config file #4620 (#5714)
* Added loginshell config file #4620

* added sample login.nu

* added environment variable loginshell-path
2022-06-06 06:52:37 -05:00
Stefan Holderbach
e5d38dcff6
Address lints from clippy for beta/nightly (#5709)
* Fix clippy lints in tests

* Replace `format!` in `.push_str()` with `write!`

Stylistically that might be a bit rough but elides an allocation.

Fallibility of allocation is more explicit, but ignored with `let _ =`
like in the clippy example:

https://rust-lang.github.io/rust-clippy/master/index.html#format_push_string

* Remove unused lifetime

* Fix macro crate relative import

* Derive `Eq` for `PartialEq` with `Eq` members

https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq

* Remove unnnecessary `.to_string()` for Cow<str>

* Remove `.to_string()` for `tendril::Tendril`

Implements `Deref<Target = str>`
2022-06-04 18:47:36 +12:00
Stefan Holderbach
a82fa75c31
Update nu-ansi-term to remove Deref impl (#5706)
Resolves an unexpected issue due to `Deref` and `ToString` interacting

Details: https://github.com/nushell/nu-ansi-term/pull/5 and https://github.com/nushell/reedline/pull/435#issuecomment-1141348209

Also updates reedline: Includes a fix for a panic when the directory containing the history is deleted during a running reedline session. (nushell/reedline#436)
2022-06-03 21:38:54 +02:00
Stefan Holderbach
0c16464320
Use search terms in the help menu search (#5708)
Currently only `help --find` was using the search terms.  With this change they will also be used by the `F1` help menu
2022-06-03 20:30:36 +02:00
Per Bothner
7a9bf06005
Minor fixes to shell integation in repl. (#5701)
Added CMD_FINISHED_MARKER to be emitted when command finishes.
Also switched the names PRE_EXECUTE_MARKER and PRE_PROMPT_MARKER
as the old names were confusing/wrong.
2022-06-02 17:57:19 -05:00
Herlon Aguiar
f6ee21f76b
nu-cli/completions: add filtering tests for variables completions (#5653) 2022-05-26 23:38:03 +02:00
Stefan Holderbach
d69a4db2e7
Unpin reedline for regular development (#5634)
Co-authored-by: JT <547158+jntrnr@users.noreply.github.com>
2022-05-26 23:21:16 +02:00
Darren Schroeder
0594f9e7aa
add case_sensitive_completions config option (#5646) 2022-05-26 09:22:20 -05:00
Herlon Aguiar
a42d419b66
nu-cli/completions: fix filter for variable completions (#5641) 2022-05-25 19:10:46 -05:00
JT
8e98df8b28
bump to dev version (#5635) 2022-05-25 19:09:44 -05:00
JT
06cf3fa5ad
Bump to 0.63 (#5627) 2022-05-25 11:33:28 +12:00
Stefan Holderbach
8018ae3286
Pin reedline v0.6.0 for the nushell v0.63.0 release (#5620)
Release notes: https://github.com/nushell/reedline/releases/tag/v0.6.0

This release contains several bug fixes and improvements to the vi-emulation and documentation.

- Improvements to the vi-style keybindings (@sadmac7000):
  - `w` now correctly moves to the beginning of the word.
  - `e` to move to the end of the word.
- Bugfixes:
  - Support terminal emulators that erroneously report a size of 0x0 by assuming a default size to avoid panics and draw nevertheless (@DhruvDh)
  - Fix `ListMenu` layout calculations. Avoids scrolling bug when wrapping occurs due to the line numbering (@ahkrr)
  - Avoid allocating to the total history capacity which can cause the application to go out of memory (@sholderbach)
- Documentation improvements including addition of documentation intended for reedline developers (@petrisch, @sholderbach)
2022-05-24 00:39:55 +02:00