1
0
mirror of https://github.com/nushell/nushell.git synced 2024-12-15 11:42:45 +01:00
Commit Graph

953 Commits

Author SHA1 Message Date
Jakub Žádník
9b99b2f6ac
Overlays ()
* WIP: Start laying overlays

* Rename Overlay->Module; Start adding overlay

* Revamp adding overlay

* Add overlay add tests; Disable debug print

* Fix overlay add; Add overlay remove

* Add overlay remove tests

* Add missing overlay remove file

* Add overlay list command

* (WIP?) Enable overlays for env vars

* Move OverlayFrames to ScopeFrames

* (WIP) Move everything to overlays only

ScopeFrame contains nothing but overlays now

* Fix predecls

* Fix wrong overlay id translation and aliases

* Fix broken env lookup logic

* Remove TODOs

* Add overlay add + remove for environment

* Add a few overlay tests; Fix overlay add name

* Some cleanup; Fix overlay add/remove names

* Clippy

* Fmt

* Remove walls of comments

* List overlays from stack; Add debugging flag

Currently, the engine state ordering is somehow broken.

* Fix (?) overlay list test

* Fix tests on Windows

* Fix activated overlay ordering

* Check for active overlays equality in overlay list

This removes the -p flag: Either both parser and engine will have the
same overlays, or the command will fail.

* Add merging on overlay remove

* Change help message and comment

* Add some remove-merge/discard tests

* (WIP) Track removed overlays properly

* Clippy; Fmt

* Fix getting last overlay; Fix predecls in overlays

* Remove merging; Fix re-add overwriting stuff

Also some error message tweaks.

* Fix overlay error in the engine

* Update variable_completions.rs

* Adds flags and optional arguments to view-source ()

* added flags and optional arguments to view-source

* removed redundant code

* removed redundant code

* fmt

* fix bug in shell_integration ()

* fix bug in shell_integration

* add some comments

* enable cd to work with directory abbreviations ()

* enable cd to work with abbreviations

* add abbreviation example

* fix tests

* make it configurable

* make cd recornize symblic link ()

* implement seq char command to generate single character sequence ()

* add tmp code

* add seq char command

* Add split number flag in `split row` ()

Signed-off-by: Yuheng Su <gipsyh.icu@gmail.com>

* Add two more overlay tests

* Add ModuleId to OverlayFrame

* Fix env conversion accidentally activating overlay

It activated overlay from permanent state prematurely which would
cause `overlay add` to misbehave.

* Remove unused parameter; Add overlay list test

* Remove added traces

* Add overlay commands examples

* Modify TODO

* Fix $nu.scope iteration

* Disallow removing default overlay

* Refactor some parser errors

* Remove last overlay if no argument

* Diversify overlay examples

* Make it possible to update overlay's module

In case the origin module updates, the overlay add loads the new module,
makes it overlay's origin and applies the changes. Before, it was
impossible to update the overlay if the module changed.

Co-authored-by: JT <547158+jntrnr@users.noreply.github.com>
Co-authored-by: pwygab <88221256+merelymyself@users.noreply.github.com>
Co-authored-by: Darren Schroeder <343840+fdncred@users.noreply.github.com>
Co-authored-by: WindSoilder <WindSoilder@outlook.com>
Co-authored-by: Yuheng Su <gipsyh.icu@gmail.com>
2022-05-08 07:39:22 +12:00
Herlon Aguiar
b0647f780d
nu-cli/completions: send original line to custom completer () 2022-05-06 16:58:42 -05:00
Darren Schroeder
2dfd975940
add -n flag to print to print without a newline ()
* add -n flag to print to print without a newline

* clippy
2022-05-06 15:33:00 -05:00
WindSoilder
e14e60dd2c
make cd recornize symblic link () 2022-05-06 10:39:48 -05:00
Darren Schroeder
78a1879e36
fix bug in shell_integration ()
* fix bug in shell_integration

* add some comments
2022-05-05 10:10:03 -05:00
Fernando Herrera
6a972312d4
added open editor event in config parsing () 2022-05-04 07:52:53 +12:00
JT
e36649f74b
Update path completions to handle spaces () 2022-05-03 12:37:38 +12:00
Richard
ab98ecd55b
Fix erroneous removal of "./" folder prefix () 2022-05-02 12:36:18 -05:00
Yuheng Su
bb27b9f371
Don't resuggest accepted completions ()
To avoid resuggesting the same completion, add a space after commands or flags that have been accepted via `Enter`. Don't do that for filepaths or external completions

* Add append_whitespace choice for suggestion

Signed-off-by: gipsyh <gipsyh.icu@gmail.com>

* Fixed `test <path>` appending space.

* Update reedline

Co-authored-by: sholderbach <sholderbach@users.noreply.github.com>
2022-05-02 11:35:37 +02:00
JT
96f8691c8d
More escaping/unescaping fixes () 2022-05-02 09:49:31 +12:00
JT
98ab31e15e
Move uses of trim_quotes to unescape for filenames ()
* Move uses of trim_quotes to unescape for filenames

* Fix Windows tests
2022-05-02 06:37:20 +12:00
Reilly Wood
5077242892
Error printing changes for watch ()
* Move CliError to nu-protocol

clean up comment

* Enable printing errors instead of just returning them

* Nicer Miette error printing in watch command
2022-05-01 19:33:41 +12:00
Richard
07893e01c1
Remove "./" prefix for file path completions () 2022-04-30 16:54:04 -05:00
Herlon Aguiar
3df03e2e6d
nu-cli/completions: complete external args as filepath () 2022-05-01 08:07:09 +12:00
Herlon Aguiar
7c6f976d65
nu-cli/completions: apply correctly nesting for env vars () 2022-04-30 14:14:04 -05:00
Tomoki Aonuma
ae9c0fc138
Fix quoting for command line args ()
* Fix quoting for command line args

* Replace custom quoting with escape_quote_string

* Use raw string for now
2022-04-30 13:23:05 -05:00
Fernando Herrera
9da2e142b2
Line buffer editor ()
* allow line editing

* cargo fmt
2022-04-30 15:40:41 +01:00
Darren Schroeder
2659ea3dbd
Revert "nu-cli/completions: better fix for files with special characters ()" ()
This reverts commit 3cf3329e49.
2022-04-29 13:11:41 -05:00
Herlon Aguiar
3cf3329e49
nu-cli/completions: better fix for files with special characters ()
* nu-cli/completions: fix paths with special chars

* add backticks

* fix replace

* added single quotes to check list

* check escape using fold

* fix clippy errors

* fix comment line

* fix conflicts

* change to vec

* skip sort checking

* removed invalid windows path

* remove comment

* added tests for escape function

* fix fn import

* fix fn import error

* test windows issue fix

* fix windows backslash path in the tests

* show expected path on error

* skip test for windows
2022-04-28 08:36:32 -05:00
Reilly Wood
187f2454c8
Move print_pipeline_data to nu-protocol () 2022-04-26 11:44:57 +12:00
Richard
9771270b38
Fuzzy completion matching ()
* Implement fuzzy match algorithm for suggestions

* Use MatchingAlgorithm for custom completions
2022-04-24 16:43:18 -05:00
Darren Schroeder
8eab311565
consolidate shell integration behind config setting ()
* consolidate shell integration behind config setting

* write output differently
2022-04-24 12:53:12 +12:00
Richard
e6a70f9846
Add MatchAlgorithm for completion suggestions ()
* Pass completion options to each fetch() call

* Add MatchAlgorithm to CompletionOptions

* Add unit test for MatchAlgorithm

* Pass completion options to directory completer
2022-04-23 10:01:19 -05:00
Herlon Aguiar
b9eb213f36
nu-cli/completions: added completion for $nu () 2022-04-23 11:49:17 +12:00
Herlon Aguiar
5ff2ae628b
nu-cli: directory syntax shape + completions () 2022-04-22 15:18:51 -05:00
Herlon Aguiar
661283c4d2
nu-cli/completions: support record for custom completions () 2022-04-22 15:17:08 -05:00
JT
96253c69fb
Use better quoting for commandline args () 2022-04-21 15:31:52 +12:00
Arnout Engelen
1295495758
typo: seach -> search () 2022-04-21 07:38:24 +12:00
Stefan Holderbach
995d8db1fe
Set to reedline main branch for development cycle ()
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 
2022-04-20 21:10:33 +12:00
Herlon Aguiar
c0ce1e9057
nu-cli/completions: fix file completions with quotes ()
* nu-cli/completions: fix file completions with quotes

* wrap with backticks
2022-04-20 16:54:37 +12:00
Herlon Aguiar
4d7b86f278
nu-cli: added tests for file completions ()
* nu-cli: added tests for file completions

* test adding extra sort

* Feature/refactor completion options ()

* Copy completion filter to custom completions

* Remove filter function from completer

This function was a no-op for FileCompletion and CommandCompletion.
Flag- and VariableCompletion just filters with `starts_with` which
happens in both completers anyway and should therefore also be a no-op.
The remaining use case in CustomCompletion was moved into the
CustomCompletion source file.

Filtering should probably happen immediately while fetching completions
to avoid unnecessary memory allocations.

* Add get_sort_by() to Completer trait

* Remove CompletionOptions from Completer::fetch()

* Fix clippy lints

* Apply Completer changes to DotNuCompletion

* add os to $nu based on rust's understanding ()

* add os to $nu based on rust's understanding

* add a few more constants

Co-authored-by: Richard <Tropid@users.noreply.github.com>
Co-authored-by: Darren Schroeder <343840+fdncred@users.noreply.github.com>
2022-04-20 16:54:00 +12:00
Richard
0de289f6b7
Feature/refactor completion options ()
* Copy completion filter to custom completions

* Remove filter function from completer

This function was a no-op for FileCompletion and CommandCompletion.
Flag- and VariableCompletion just filters with `starts_with` which
happens in both completers anyway and should therefore also be a no-op.
The remaining use case in CustomCompletion was moved into the
CustomCompletion source file.

Filtering should probably happen immediately while fetching completions
to avoid unnecessary memory allocations.

* Add get_sort_by() to Completer trait

* Remove CompletionOptions from Completer::fetch()

* Fix clippy lints

* Apply Completer changes to DotNuCompletion
2022-04-19 13:59:10 -05:00
JT
76079d5183
Move config to be an env var ()
* Move config to be an env var

* fix fmt and tests
2022-04-19 10:28:01 +12:00
Herlon Aguiar
dd1d9b7623
nu-cli/completions: completion for use and source ()
* nu-cli/completions: completion for use and source

* handle subfolders for different base dirs

* fix clippy errors
2022-04-19 00:59:13 +12:00
Kat Marchán
1314a87cb0
update miette and switch to GenericErrors () 2022-04-19 00:34:10 +12:00
Marc Schreiber
a35b975d84
Shell Integration ()
This commit renders ANSI chars in order to provide shell integrations
such Kitty's opening feature that captures the output of the last
command in a pager such as less.

Fixes 
2022-04-16 22:03:02 -05:00
Herlon Aguiar
cb3276fb3b
nu-cli/completions: removed unnecessary bool () 2022-04-16 13:34:38 +12:00
Tomoki Aonuma
c17129a92a
Fix env capture ()
* Fix env capture

* Add test for env capture
2022-04-16 10:38:27 +12:00
Herlon Aguiar
13b371ab58
nu-cli/completions: add completion for record vars () 2022-04-16 08:24:41 +12:00
Herlon Aguiar
2a3991cfdb
nu-cli/completions: add completion for $env. ()
* nu-cli/completions: add completion for $env.

* use stack to avoid showing hidden env vars
2022-04-15 16:17:53 +03:00
Stefan Holderbach
836f914163
Clean REPL code, hide Hints without ANSI coloring ()
- With a change to reedline hints can now be hidden. This is useful when
no ANSI coloring is available as hints become indistinguishable from the
actual buffer
- remove commented out code
- order the logging calls according to the implementation
2022-04-12 06:19:42 +12:00
Stefan Holderbach
625e807a35
Support unbinding a particular key event ()
To remove a default keybinding for a particular edit mode, set the `event: null`:

e.g. to disable screen clearing with Ctrl-L

```
let $config = {keybindings: [{
        modifier: control
        keycode: char_l
        mode: [emacs, vi_normal, vi_insert]
        event: null
      } ]}

```
2022-04-10 23:54:09 +02:00
Stefan Holderbach
d18f34daa4
Allow overriding of menu keybindings ()
Keybindings that were attached to menus like `Ctrl-x` or `Ctrl-q` could not be replaced with custom bindings
2022-04-10 22:48:55 +02:00
Hristo Filaretov
683b912263
Track call arguments in a single list ()
* Initial implementation of ordered call args

* Run cargo fmt

* Fix some clippy lints

* Add positional len and nth

* Cargo fmt

* Remove more old nth calls

* Good ole rustfmt

* Add named len

Co-authored-by: Hristo Filaretov <h.filaretov@protonmail.com>
2022-04-09 14:55:02 +12:00
JT
5afd45414e
Revert "nu-cli/completions: cache layer for fetching ()" ()
This reverts commit e86c1b118e.
2022-04-08 21:48:27 +12:00
Fernando Herrera
6b4cb8b0e0
short descriptions () 2022-04-08 07:57:39 +01:00
Herlon Aguiar
48fa25fd42
nu-cli/completions: removed default filter for command () 2022-04-07 18:45:04 -05:00
Herlon Aguiar
e86c1b118e
nu-cli/completions: cache layer for fetching () 2022-04-08 07:36:16 +12:00
Herlon Aguiar
5e177fe8e7
nu-cli/completions: fix file completions filtering () 2022-04-08 07:31:56 +12:00
JT
ef1934a7ee
Remove external name exceptions () 2022-04-07 14:01:31 +12:00
Herlon Aguiar
c3bed1352a
nu-cli/completions: prioritize non hidden folders () 2022-04-06 16:56:43 +01:00
Fernando Herrera
3ceb39c82c
use arc to avoid cloning entire engine for menus ()
* use arc to avoid cloning entire engine for menus

* remove complete import path

* remove stack clone

* reference in completer
2022-04-06 13:25:02 +01:00
Herlon Aguiar
13869e7d52
nu-cli: refactor completions () 2022-04-06 19:58:55 +12:00
Fernando Herrera
fa6ed7a40b
allow record as text style () 2022-04-04 22:36:48 +01:00
sholderbach
80f21d37e0
Update reedline to mut Completer API 2022-04-04 23:35:31 +02:00
JT
abe028f930
Add raw strings, use raw strings for env () 2022-04-05 08:42:26 +12:00
Herlon Aguiar
ef1cf7e634
feature: Add some context to completions ()
* send current line and position

* copy current line

* fix error

* deleted test completion
2022-04-05 06:31:40 +12:00
Fernando Herrera
608b6f3634
Generic menus ()
* updated to reedline generic menus

* help menu with examples

* generic menus in the engine

* description menu template

* list of menus in config

* default value for menu

* menu from block

* generic menus examples

* change to reedline git path

* cargo fmt

* menu name typo

* remove commas from default file

* added error message
2022-04-04 15:54:48 +01:00
Reilly Wood
a86e6ce89b
Set LAST_EXIT_CODE on parse error () 2022-04-04 06:11:27 -05:00
JT
80c9888f82
Add command descriptions to completions () 2022-04-02 08:18:11 +13:00
JT
1d2d31580b
Allow strings for prompt env vars () 2022-04-01 12:00:50 +13:00
Stefan Holderbach
2193910579
Update reedline to new constructor API () 2022-04-01 11:16:28 +13:00
Stefan Holderbach
0986c61a5d
Lift line editor construction out of loop ()
Enables the use of some features on reedline

- Keeping the line when clearing the screen with `Ctrl-L`
- Using the internal cut buffer between lines
- Submitting external commands via keybinding and keeping the line

Additional effect:

Keep the history around and do basic syncs (performance improvement
minimal as session changes have to be read and written)

Additional change:

Give the option to defer writing/rereading the history file to the
closing of the session ($config.sync_history_on_enter)
2022-03-31 23:25:48 +02:00
Darren Schroeder
05f7d7d38b
finish hooking up completion descriptions () 2022-03-31 11:13:16 -05:00
Fernando Herrera
385bc40627
evaluate indicators as commands ()
* evaluate indicators are commands

* default strings in config

* default multiline

* removed build string command
2022-03-31 06:22:55 +01:00
JT
0afa18ac4a
Use real stack during custom completion () 2022-03-29 06:49:41 +13:00
JT
a87f53072a
See if levenshtein sorting feels goofor completions () 2022-03-28 13:31:31 +13:00
JT
911fba8a8a
Help menu improvements ()
* Help menu improvements

* default config
2022-03-27 15:21:40 -05:00
Fernando Herrera
a4410fef40
Help menu ()
* 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
2022-03-27 14:01:04 +01:00
JT
19fa41b114
Fix single quote environment values ()
* Fix single quote external values

* Try to fix windows

* fix test

* fix test
2022-03-26 09:14:48 +13:00
JT
983d115bc0
Add an alias denylist for expansions () 2022-03-19 08:03:57 +13:00
Darren Schroeder
ca12f39db3
added nu-utils crate, fixed issue where externals turn off vt processing ()
* added `nu-utils` crate, fixed issue where externals turn off vt processing

* hopefully make work in non-windows environments

* clippy
2022-03-16 17:21:06 -05:00
Charles Dixon
1a16b9a2c4
Move repl loop and command/script execution to nu_cli ()
* Refactor usage of is_perf_true to be a parameter passed around

* Move repl loop and command/script execution to nu_cli

* Move config setup out of nu_cli

* Update config_files.rs

* Update main.rs

Co-authored-by: JT <547158+jntrnr@users.noreply.github.com>
2022-03-17 07:17:06 +13:00
JT
9abb14b5fd
ensure exit codes in more cases () 2022-03-10 06:29:23 -05:00
JT
12bf23faa6
Move completions to DeclId ()
* Move completions to DeclId

* fmt

* fmt
2022-03-10 09:49:02 +02:00
JT
299fea8538
Fix external extra ()
* Fix empty table from externals

* Fix empty table from externals
2022-03-07 20:17:33 -05:00
JT
e64ca97fe2
move scope variable into nu variable () 2022-03-04 11:36:11 -05:00
Genna Wingert
47d5501f9f
Add aliases to command completions () 2022-03-03 15:07:13 -05:00
JT
7d0531d270
Add support for escape characters, make nuon a JSON superset ()
* WIP

* Finish adding escape support in strings

* Try to fix windows
2022-03-03 13:14:03 -05:00
Genna Wingert
13f2048ffb
Add completion options for custom completions ()
* Add completion options for custom completions

* Make clippy happy

* Refactor options for clarity

* Make return type of filtering explicit
2022-03-03 09:45:35 -05:00
JT
96a1bf5f8d
Experiment: Allow both $true/true and $false/false ()
* Change true/false to keywords

* oops, clippy

* Both kinds of bools

* Add in some boolean variables

* disable py virtualenv test for now
2022-03-02 19:55:03 -05:00
JT
a6a96b29cb
Add binary literals () 2022-02-28 18:31:53 -05:00
Stefan Holderbach
799fa98411
Update reedline, revert crossterm ()
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.
2022-02-26 11:23:05 -06:00
JT
0c3ea636fb
Add support for stderr and exit code () 2022-02-25 14:51:31 -05:00
JT
3c62d27c28
Try again with math-like externals ()
* Try again with math-like externals

* clippy 1.59

* clippy 1.59

* clippy 1.59
2022-02-24 14:02:28 -05:00
JT
4b18fdcc6e
Date literals ()
* Date literals

* update deps

* Add date+duration
2022-02-23 21:02:48 -05:00
JT
9888f8f298
Add pipeline redirection support ()
* redirection

* Remove commented-out

* fix tests

* more fixes
2022-02-21 17:22:21 -05:00
JT
a96f8b891e
more strict nuon handling, better nuon errors ()
* more strict nuon handling, better nuon errors

* Improve errors a bit more
2022-02-20 22:31:50 -05:00
JT
6024a17a5b
Remove stray println ()
* Default config improvements

* Finish cleanup

* Add some comments

* remove println
2022-02-20 09:41:16 -05:00
JT
643c5097d6
Default config improvements ()
* Default config improvements

* Finish cleanup

* Add some comments
2022-02-20 07:48:46 -05:00
JT
f085bd97f6
Add some more builtin var completions () 2022-02-18 14:34:40 -05:00
Jakub Žádník
c893cc1485
Add config to NuCompleter () 2022-02-18 13:54:13 -05:00
JT
06f9047be4
Add an explicit 'print' command () 2022-02-18 13:43:34 -05:00
JT
56b3fc61a3
Remove statements, replaced by pipelines () 2022-02-15 14:31:14 -05:00
JT
eceb2d5106
Early return on subcommands ()
* Early return on subcommands

* More streamlining
2022-02-12 11:39:38 -05:00
JT
cc171b6ad4
Improve completions with no starting characters ()
* Improve completions with no starting characters

* Fix subexpressions, crashes, and differentiate externals
2022-02-12 10:04:10 -05:00
JT
a16e485cce
Add support for defining known externals with their own custom completions ()
* WIP for known externals

* Now completions can work from scripts

* Add support for definiing externs

* finish cleaning up old proof-of-concept
2022-02-11 13:38:10 -05:00
JT
a767fa369c
Improve quote path completions with drill-down () 2022-02-11 09:42:15 -05:00
JT
e16d6ae00c
Improve external command completions with spaces () 2022-02-11 07:05:48 -05:00
JT
d70d91e559 Remove old nushell/merge engine-q 2022-02-07 14:54:06 -05:00
Fernando Herrera
fdce6c49ab engine-q merge 2022-02-07 19:11:34 +00:00
JT
de4449c3ee
Fix completion duplicates () 2022-02-06 16:33:33 -05:00
JT
1a246d141e
Improve subcommand completions () 2022-02-04 08:38:23 -05:00
JT
e11ac9f6f8
Harden highlighter against alias spans () 2022-01-28 07:29:45 -05:00
Fernando Herrera
267ff4b0cf
using menu trait () 2022-01-27 07:53:23 +00:00
Fernando Herrera
69954a362d
history-menu () 2022-01-25 09:39:22 +00:00
JT
3d0b1ef1ce
Highlight help tutor ()
* WIP

* Syntax highlight help, add tutor
2022-01-25 02:05:19 +11:00
JT
310ecb79b6
Add flag completions () 2022-01-22 16:18:31 -05:00
Fernando Herrera
846a048bba
menu-performance () 2022-01-21 08:59:29 +00:00
Darren Schroeder
65ef7b630b
PATH for completions for each os () 2022-01-20 13:46:52 -05:00
JT
33ffb2c39a
Add which command, add external completions, and builtin var completions ()
* Add which and external completions

* WIP

* Finish up external and var completions

* fix windows
2022-01-21 05:02:53 +11:00
JT
f562a4526c
Fix clippy lints ()
* Fix clippy lints

* Fix clippy lints

* Fix clippy lints
2022-01-18 23:33:28 +11:00
Fernando Herrera
8a0d2b4e32
double prompt ()
* double prompt

* prompt env var name
2022-01-06 12:57:55 +00:00
Jakub Žádník
74dcd91cc3
Use only $nu.env.PWD for getting the current directory ()
* Use only $nu.env.PWD for getting current directory

Because setting and reading to/from std::env changes the global state
shich is problematic if we call `cd` from multiple threads (e.g., in a
`par-each` block).

With this change, when engine-q starts, it will either inherit existing
PWD env var, or create a new one from `std::env::current_dir()`.
Otherwise, everything that needs the current directory will get it from
`$nu.env.PWD`. Each spawned external command will get its current
directory per-process which should be thread-safe.

One thing left to do is to patch nu-path for this as well since it uses
`std::env::current_dir()` in its expansions.

* Rename nu-path functions

*_with is not *_relative which should be more descriptive and frees
"with" for use in a followup commit.

* Clone stack every each iter; Fix some commands

Cloning the stack each iteration of `each` makes sure we're not reusing
PWD between iterations.

Some fixes in commands to make them use the new PWD.

* Post-rebase cleanup, fmt, clippy

* Change back _relative to _with in nu-path funcs

Didn't use the idea I had for the new "_with".

* Remove leftover current_dir from rebase

* Add cwd sync at merge_delta()

This makes sure the parser and completer always have up-to-date cwd.

* Always pass absolute path to glob in ls

* Do not allow PWD a relative path; Allow recovery

Makes it possible to recover PWD by proceeding with the REPL cycle.

* Clone stack in each also for byte/string stream

* (WIP) Start moving env variables to engine state

* (WIP) Move env vars to engine state (ugly)

Quick and dirty code.

* (WIP) Remove unused mut and args; Fmt

* (WIP) Fix dataframe tests

* (WIP) Fix missing args after rebase

* (WIP) Clone only env vars, not the whole stack

* (WIP) Add env var clone to `for` loop as well

* Minor edits

* Refactor merge_delta() to include stack merging.

Less error-prone than doing it manually.

* Clone env for each `update` command iteration

* Mark env var hidden only when found in eng. state

* Fix clippt warnings

* Add TODO about env var reading

* Do not clone empty environment in loops

* Remove extra cwd collection

* Split current_dir() into str and path; Fix autocd

* Make completions respect PWD env var
2022-01-05 09:30:34 +11:00
JT
4d1ce6c27b
Use default prompt as fallback () 2022-01-05 06:49:04 +11:00
JT
fe5f65a247
Highlight block and record () 2022-01-03 16:21:26 +11:00
JT
9535e2c309
Fix list and table print ()
* Fix list printing

* Fix list and table highlighting
2022-01-03 14:18:23 +11:00
Darren Schroeder
a56994ccc5
make prompt indicators configurable ()
* make prompt indicators configurable

* seems to be working now
2022-01-02 09:53:16 +11:00
JT
ac487dfcbc
Add parser tracing, fix 629 () 2022-01-02 08:42:50 +11:00
JT
ca6baf7a46
Add single tick string interpolation ()
* Add single tick string interpolation

* give string interpolation its own highlighting
2021-12-26 07:50:02 +11:00
JT
266fac910a
Signature improves, sorted completions () 2021-12-22 07:50:18 +11:00
Fernando Herrera
e949658381
nothing variable ()
* nothing variable

* corrected comments

* added color to nothing like bool

* compare nothing with values

* comparison tests
2021-12-20 12:05:33 +11:00
Jakub Žádník
6a0f404558
Treating environment variables as Values ()
* Proof of concept treating env vars as Values

* Refactor env var collection and method name

* Remove unnecessary pub

* Move env translations into a new file

* Fix LS_COLORS to support any Value

* Fix spans during env var translation

* Add span to env var in cd

* Improve error diagnostics

* Fix non-string env vars failing string conversion

* Make PROMPT_COMMAND a Block instead of String

* Record host env vars to a fake file

This will give spans to env vars that would otherwise be without one.
Makes errors less confusing.

* Add 'env' command to list env vars

It will list also their values translated to strings

* Sort env command by name; Add env var type

* Remove obsolete test
2021-12-17 12:04:54 +11:00
Darren Schroeder
9a864b5017
allow flatshape (command line syntax) theming ()
* allow flatshape (command line syntax) theming

* renamed crate, organized
2021-12-16 06:17:29 -06:00
JT
906c0e6bca
Better filepath completions () 2021-12-13 17:46:30 +11:00
JT
bee7ef21eb
Add in variable and sub-command completions ()
* WIP

* wip

* Add in variable and subcommand completions

* clippy
2021-12-13 10:18:31 +11:00
JT
8cf4402e6c
Reset ansi more often when showing errors () 2021-12-04 18:02:57 +13:00
Andrew Houts
79c7b20cfd
add login shell flag () 2021-12-02 20:05:04 +13:00
Darren Schroeder
f5b20f0e3b
try to match most of nushell syntax coloring () 2021-11-11 06:55:10 +13:00
JT
02b8027749
Improve external output in subexprs () 2021-11-06 18:50:33 +13:00
JT
85a69c0a45 WIP 2021-10-26 10:14:21 +13:00
JT
5d19017603 WIP 2021-10-26 05:58:58 +13:00
JT
b5965ee8ef WIP 2021-10-25 19:31:39 +13:00
JT
b6d269e90a WIP 2021-10-25 17:01:02 +13:00
JT
6024a001b4 Clarify todo/fixmes 2021-10-13 06:44:23 +13:00
JT
96419f168b Also fix the flag params 2021-10-12 10:17:45 +13:00
JT
dea9c1482b Allow vars and subexprs in extern args 2021-10-09 10:51:47 +13:00
Darren Schroeder
22cfe4391e
remove history file after clearing it () 2021-10-07 10:09:31 -05:00
JT
7eb022b58c Adapt tk's work for a source command 2021-10-06 15:29:05 +13:00
Tanishq Kancharla
d481d5ca96 Merge branch 'main' of https://github.com/nushell/engine-q into source-command 2021-10-05 22:16:07 -04:00
Tanishq Kancharla
011ad2e4e6 Merge branch 'source-command' of https://github.com/moonrise-tk/engine-q into source-command 2021-10-05 21:59:26 -04:00
Tanishq Kancharla
d6d0bad7aa reverted 2021-10-05 21:59:16 -04:00
JT
31ce8c1e33 Variable completions and better ls 2021-10-05 15:46:24 +13:00
JT
c884d5ca31 Better completions for external args 2021-10-05 10:50:46 +13:00
JT
a88058006a Add path completions 2021-10-05 08:21:31 +13:00
Fernando Herrera
6f4df31927 removed comments 2021-10-02 14:16:37 +01:00
Fernando Herrera
03339beae1 prompt with env variable 2021-10-02 14:10:28 +01:00
hedonihilist
62c5df5fc6
expand tilde when reading plugin_dirs () 2021-10-02 21:38:21 +13:00
JT
0ccbebee7a multiline validation 2021-09-22 17:29:53 +12:00
Kat Marchán
a1d6cefdf8
replace codespan-reporting with miette 3.0 2021-09-20 17:14:20 -07:00