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>
* Fix `ls` for Windows system files
* Fix non-Windows builds
* Make Clippy happy on non-Windows platforms
* Fix new test on GitHub runners
* Move ls Windows code into its own module
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)
Fixes#5593 (OOM introduced with #5587 when no config was present and an attempt was
made to allocate all memory in advance)
Includes also other changes to reedline:
- Vi word definition fixed and `w` and `e` work as expected
* lazyframe definition
* expressions and lazy frames
* new alias expression
* more expression commands
* updated to polars main
* more expressions and groupby
* more expressions, fetch and sort-by
* csv reader
* removed open csv
* unique function
* joining functions
* join lazy frames commands with eager commands
* corrected tests
* Update .gitignore
* Update .gitignore
Co-authored-by: JT <547158+jntrnr@users.noreply.github.com>
* database commands
* db commands
* filesystem opens sqlite file
* clippy error
* corrected error in ci file
* removes matrix flag from ci
* flax matrix for clippy
* add conditional compile for tests
* add conditional compile for tests
* correct order of command
* correct error msg
* correct typo
Changes to reedline since `v0.4.0`:
- vi normal mode `I` for inserting at line beginning
- `InsertNewline` edit command that can be bound to `Alt-Enter` if
desired to have line breaks without relying on the `Validator`
- `ClearScreen` will directly clear the visible screen. `Signal::CtrlL` has been
removed.
- `ClearScrollback` will clear the screen and scrollback. Can be used to
mimic macOS `Cmd-K` screen clearing. Helps with #5089
* Add timestamp flag to `touch` command
* Add modify flag to `touch` command
* Add date flag to `touch` command
* Remove unnecessary `touch` test and fix tests setups
* Change `touch` flags descriptions
* Update `touch` example
* Add reference flag to `touch` command
* Add access flag to `touch` command
* Add no-create flag to `touch` command
* Replace `unwrap` with `expect`
* nu-completer with suggestions
* help menu with scrolling
* updates description rows based on space
* configuration for help menu
* update nu-ansi-term
* corrected test for update cells
* changed keybinding
* Add android as target os for procfs-based ps
* Turn off code for dealing with trash on platforms which are known to not support a standard trash protocol
* Update lib.rs
* Update lib.rs
Co-authored-by: JT <547158+jntrnr@users.noreply.github.com>
At the moment `crossterm` apparently has a regression decoding certain important key combinations on Windows.
Thus reedline reverted to the previous version.
Some changes are necessary to remove the need for `crossterm` in the use of `lscolors`.
Introduces two local conversion traits.
Additionally update the `Highlighter` API to support the cursor
position.
This will enable brace/statement match highlighting.
* Switch to short-names when the path is a relative_path (a dir) and exit with an error if the path does not exist
* Remove debugging print line
* Show relative filenames... It does not work yet for ls ../
* Try something else to fix relative paths... it works, but the ../ code part is not very pretty
* Add canonicalize check and remove code clones
* Fix the canonicalize_with issue pointed out by kubouch. Not sure the prefix_str is what kubouch suggested
* Fix the canonicalize_with issue pointed out by kubouch. Not sure the prefix_str is what kubouch suggested
* Add single-dot expansion to nu-path
* Move value path expansion from parser to eval
Fixes#745
* Remove single dot expansion from parser
It is not necessary since it will get expanded anyway in the eval.
* Fix ls to display globs with relative paths
* Use pathdiff crate to get relative paths for ls
Co-authored-by: Stefan Stanciulescu <contact@stefanstanciulescu.com>
* Move fetch to extra
* Move byte stream code to a function instead of copying it twice
* Fix formatting issues
* Make fetch a default command
* Fix formatting
* Port fetch to engine-q
* Fix check for path as a string
* Add a timeout flag and fix some span issues
* Add a temporary fetch command that returns byte streams. Got rid of async stuff as we're using the blocking feature of tokio
* More tweaks for the bytestream
* Rewrite fetch using ByteStreams
* buffer read on bytes directly
Co-authored-by: Stefan Stanciulescu <contact@stefanstanciulescu.com>
I removed the Inflector dependency in favor of heck for two reasons:
- to close#3674.
- heck seems simpler and actively maintained
We could probably alter the structure of the `str_` module to expose the
individual casing behaviors better.
I did not feel as confident on changing those signatures.
So I took a lazier approach of a macro in the `mod.rs` that creates the public
shimming function to heck's traits.
* First iteration of the version command
* Cleanup
* Fix the installed plugins bug
* Fix fmt check issue
* Fix clippy warning
* Fixing all clippy warnings
* Remove old code
* MathEval Variance and Stddev
* Fix tests and linting
* Typo
* Deal with streams when they are not tables
* First draft of these commands
* To MD
* To md and to html
* Fixed cargo and to_md
* `into_abbreviated_string` instead of `into_string`
* Changed how inner tables are displayed
* add icons to grid output. still needs cleanup
* working but adds a dependency on ansi_term - need to fix that
* update styling, added lots of green code to icons
* clippy
* add config point for grid icons
* option to replace command same name
* moved order of custom value declarations
* arranged dataframe folders and objects
* sort help commands by name
* added dtypes function for debugging
* corrected name for dataframe commands
* command names using function
* MathEval Variance and Stddev
* Fix tests and linting
* Typo
* Deal with streams when they are not tables
* `from toml` command
* From ods
* From XLSX
* From ics
* From ini
* From vcf
* Forgot a eprintln!
* custom value trait
* functions for custom value trait
* custom trait behind flag
* open dataframe command
* command to-df for basic types
* follow path for dataframe
* dataframe operations
* dataframe not default feature
* custom as default feature
* corrected examples in command
* MathEval Variance and Stddev
* Fix tests and linting
* Typo
* Deal with streams when they are not tables
* `from toml` command
* From ods
* From XLSX
* MathEval Variance and Stddev
* Fix tests and linting
* Typo
* Deal with streams when they are not tables
* FromEml and FromUrl
Added tests for from eml
* MathEval Variance and Stddev
* Fix tests and linting
* Typo
* Deal with streams when they are not tables
* `from yaml` and `from yml`
`from yaml` and `from yml`
from yaml and from yml
* Fix collect_string
* Fix tests and linting
* Port camel case and kebab case
* Port pascal case
* Port snake case and screaming snake case
* Cleanup before PR
* Add back cell path support for str case commands
* Add cell path tests for str case command
* Revert "Add cell path tests for str case command"
This reverts commit a0906318d95fd2b5e4f8ca42f547a7e4c5db381a.
* Add cell path test cases for str case command
* Move cell path tests from tests.rs to Examples in each of the command's file
Co-authored-by: Stefan Stanciulescu <contact@stefanstanciulescu.com>
* compiles on nightly now. (breaking change)
* less deps
* Switch over to new resolver
(it's been stable for a while.)
* let's leave num-format for another PR
* Resolve rebase artifacts
* Remove leftover dependencies on removed feature
* Remove unnecessary 'pub'
* Start taking notes and fooling around
* Split canonicalize to two versions; Add TODOs
One that takes `relative_to` and one that doesn't.
More TODO notes.
* Merge absolutize to and rename resolve_dots
* Add custom absolutize fn and use it in path expand
* Convert a couple of dunce::canonicalize to ours
* Update nu-path description
* Replace all canonicalize with nu-path version
* Remove leftover dunce dependencies
* Fix broken autocd with trailing slash
Trailing slash is preserved *only* in paths that do not contain "." or
"..". This should be fixed in the future to cover all paths but for now
it at least covers basic cases.
* Use dunce::canonicalize for canonicalizing
* Alow cd recovery from non-existent cwd
* Disable removed canonicalize functionality tests
Remove unused import
* Break down nu-path into separate modules
* Remove unused public imports
* Remove abundant cow mapping
* Fix clippy warning
* Reformulate old canonicalize tests to expand_path
They wouldn't work with the new canonicalize.
* Canonicalize also ~ and ndots; Unify path joining
Also, add doc comments in nu_path::expansions.
* Add comment
* Avoid expanding ndots if path is not valid UTF-8
With this change, no lossy path->string conversion should happen in the
nu-path crate.
* Fmt
* Slight expand_tilde refactor; Add doc comments
* Start nu-path integration tests
* Add tests TODO
* Fix docstring typo
* Fix some doc strings
* Add README for nu-path crate
* Add a couple of canonicalize tests
* Add nu-path integration tests
* Add trim trailing slashes tests
* Update nu-path dependency
* Remove unused import
* Regenerate lockfile
The nu-serde crate allows us to become much more generic with respect to how we
convert output to `nu-protocol::Value`s. This allows us to remove a lot of the
special-case code that we wrote for deserializing JSON values.
Co-authored-by: Darren Schroeder <343840+fdncred@users.noreply.github.com>
* nuframe in its own type in UntaggedValue
* Removed eager dataframe from enum
* Dataframe created from list of values
* Corrected order in dataframe columns
* Returned tag from stream collection
* Removed series from dataframe commands
* Arithmetic operators
* forced push
* forced push
* Replace all command
* String commands
* appending operations with dfs
* Testing suite for dataframes
* Unit test for dataframe commands
* improved equality for dataframes
* moving all dataframe operations to protocol
Hashers now uses on Rust Crypto Digest trait which makes it trivial to
implement additional hash functions.
The original `md5` crate does not implement the Digest trait and was
replaced by `md-5` crate which does. Sha256 uses already included `sha2`
crate.
Nothing used the `ptree` feature or optional dependency within
`nu-command` except to include it within the `version` output. This
may be related to when `nu-cli` also had a `ptree` feature, but
I'm not sure.
That leaves the code within `nu_plugin_tree` as the sole remaining
user of `ptree`, which is already covered by the feature `tree`
and included in the `version` output.
* Type in command description
* filter name change
* Clean column name
* Clippy error and updated polars version
* Lint correction in file
* CSV Infer schema optional
* Correct float operations
* changes in series castings to allow other types
* Clippy error correction
* Removed lists from command signatures
* Added not command for series
* take command with args
* set with idx command
* Sample command
* Join command with checks
* More dataframes commands
* Groupby and aggregate commands
* Missing feature dataframe flag
* Renamed file
* New commands for dataframes
* error parser and df reference
* filter command for dataframes
* removed name from nu_dataframe
* commands to save to parquet and csv
* polars new version
* new dataframe commands
* series type and print
* Series basic arithmetics
* Add new column to dataframe
* Command names changed to nushell standard
* Sample command
* Join command with checks
* More dataframes commands
* Groupby and aggregate commands
* Missing feature dataframe flag
* Renamed file
* New commands for dataframes
* error parser and df reference
* filter command for dataframes
* removed name from nu_dataframe
* commands to save to parquet and csv
* Dataframe MVP
* Removed test csv file
* Dataframe MVP
* Removed test csv file
* New revision polars
* New revision polars
* csv file reader
* argument parser for file reader
* Parser from Row primitive
* Column conversion
* Added as f32 and f64
* Parsing row to dataframe
* Removed repeated push to vector
* Accept table values to create dataframe
* Removed default serde
* Dataframe to rows to show data
* Save name of file with dataframe
* Usage example
* Upgrade polars version
* Clippy changes
* Added print function with head and tail
* Move dataframe struct to folder
* Lock file after running tests and merge
* Optional feature for dataframe
* Removed dataframe from plugins
* Update primitive.rs
Co-authored-by: JT <jonathandturner@users.noreply.github.com>
* add nu-pretty-hex, add into binary, update binaryview
* updated parameter name, updated examples
* fixed nu-pretty-hex test
* fixed tests again! and added a no color option to pretty-hex
* Playground infraestructure (tests, etc) additions.
A few things to note:
* Nu can be started with a custom configuration file (`nu --config-file /path/to/sample_config.toml`). Useful for mocking the configuration on test runs.
* When given a custom configuration file Nu will save any changes to the file supplied appropiately.
* The `$nu.config-path` variable either shows the default configuration file (or the custom one, if given)
* We can now run end to end tests with finer grained control (currently, since this is baseline work, standard out) This will allow to check things like exit status, assert the contents with a format, etc)
* Remove (for another PR)
* use the InputHandler functionality from minus
* respond to Q and ESC character to quit
* use arijit79/minus main branch until new release is pushed
* rename NushellMinusInputHandler to MinusInputHandler