Commit Graph

48 Commits

Author SHA1 Message Date
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
Maxim Zhiburt
217c2bae99
Move wrap responsibility on tabled (#5999)
* nu_table/ Replace wrap.rs logic by tabled::Width::wrap

Signed-off-by: Maxim Zhiburt <zhiburt@gmail.com>

* nu_table: Rename wrap.rs to width_control.rs

Signed-off-by: Maxim Zhiburt <zhiburt@gmail.com>

* nu_table: Add configuration of trimming

```
let-env config = ($env.config | upsert table_trim { methodology: 'wrapping', wrapping_try_keep_words: false })
let-env config = ($env.config | upsert table_trim { methodology: 'truncating', truncatting_suffix: '...@@...' })
```

Signed-off-by: Maxim Zhiburt <zhiburt@gmail.com>

* nu_table: Fix right padding issue

Signed-off-by: Maxim Zhiburt <zhiburt@gmail.com>

* nu_table: Fix trancate issue

Signed-off-by: Maxim Zhiburt <zhiburt@gmail.com>

* nu_table: Fix spelling in config

Signed-off-by: Maxim Zhiburt <zhiburt@gmail.com>

* nu_table: Update tabled dependency

Signed-off-by: Maxim Zhiburt <zhiburt@gmail.com>

* Update default_config.nu with a table_trim options

Signed-off-by: Maxim Zhiburt <zhiburt@gmail.com>
2022-07-12 11:23:50 -05:00
JT
a5470b2362
use simpler reedline (#6016) 2022-07-12 13:25:31 +12: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
Darren Schroeder
0594f9e7aa
add case_sensitive_completions config option (#5646) 2022-05-26 09:22:20 -05:00
JT
a3a9571dac
Add environment change hook (#5600)
* add environment change hook

* clippy
2022-05-21 09:49:42 +12:00
Stefan Holderbach
8fdc272bcc
Use effectively unlimited history size if not set (#5587)
Fixes #5586
2022-05-19 12:42:41 -05:00
JT
3a35bf7d4e
Add hooks to cli/repl (#5479)
* Add hooks to cli/repl

* Clippy

* Clippy
2022-05-09 07:28:39 +12:00
Darren Schroeder
768ff47d28
enable cd to work with directory abbreviations (#5452)
* enable cd to work with abbreviations

* add abbreviation example

* fix tests

* make it configurable
2022-05-06 07:58:32 -05:00
Fernando Herrera
9da2e142b2
Line buffer editor (#5381)
* allow line editing

* cargo fmt
2022-04-30 15:40:41 +01:00
Darren Schroeder
5999506f87
allows for nushell to have tables without the index column (#5380) 2022-04-30 09:07:46 -05:00
Richard
9771270b38
Fuzzy completion matching (#5320)
* 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 (#5302)
* consolidate shell integration behind config setting

* write output differently
2022-04-24 12:53:12 +12:00
Fernando Herrera
fa6ed7a40b
allow record as text style (#5092) 2022-04-04 22:36:48 +01:00
Fernando Herrera
608b6f3634
Generic menus (#5085)
* 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
Stefan Holderbach
0986c61a5d
Lift line editor construction out of loop (#5041)
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
Fernando Herrera
a4410fef40
Help menu (#4992)
* 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
Fernando Herrera
2fd42d25b1
partial completions (#4704) 2022-03-03 11:13:44 +02:00
JT
2ba12afb01
A few fixes to docs generation and default config (#4570)
* A few fixes to docs generation and default config

* A few more fixes
2022-02-20 15:20:41 -05:00
Jakub Žádník
56aacc4852
Use environment variable for env_conversions (#4566)
* Handle string->value env conv. with env. var.

Also adds the environment variable for Path/PATH and removes it from
config.

* Simplify getting the string->value conversion

* Refactor env conversion into its own function

* Use env var for to_string conversion; Remove conf

* Fix indentation in default config
2022-02-20 16:27:59 +02:00
JT
43850bf20e
Re-port filesystem commands (#4387)
* Re-port the filesystem commands

* Remove commented out section
2022-02-09 09:56:27 -05:00
JT
522a53af68
Add support for quick completions (#927) 2022-02-04 10:30:21 -05:00
Fernando Herrera
69954a362d
history-menu (#846) 2022-01-25 09:39:22 +00:00
JT
be8c905ca7
Show error on bad config, but keep going (#778) 2022-01-20 03:42:12 +11:00
Fernando Herrera
6514a30b5d
general keybindings (#775)
* general keybindings

* get value function

* check error for keybinding

* cmd and send for keybingins

* better error message
2022-01-19 07:28:08 -06:00
Fernando Herrera
ff9d88887b
simple event keybinding (#773) 2022-01-18 19:32:45 +00:00
Fernando Herrera
20eb348896
simple keybinding parsing (#768) 2022-01-18 08:48:28 +00:00
Fernando Herrera
89d99db94f
menu options (#748) 2022-01-15 17:01:44 +00:00
JT
ac487dfcbc
Add parser tracing, fix 629 (#638) 2022-01-02 08:42:50 +11:00
JT
15b979b06e
Bump reedline (#634) 2022-01-01 09:41:29 +11:00
Darren Schroeder
ba1ff4cf6c
add configuration of maximum history size (#563) 2021-12-23 13:59:00 -06:00
Fernando Herrera
f3c175562d
vi mode (#561) 2021-12-23 09:31:16 +00:00
Jakub Žádník
deeb1da359
Allow having only one env conversion (#548)
Allows setting only `from_string` or `to_string` in `env_conversions`
config. Previously, both were required.
2021-12-22 00:32:38 +02:00
Jakub Žádník
6a0f404558
Treating environment variables as Values (#497)
* 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
a5c1dd0da5
allow fg, bg, attributes to be set for all colors in color_config (#489)
* allow fg, bg, attributes to be set for all colors in color_config

* no need for comma between each key value
2021-12-14 13:34:39 -06:00
Darren Schroeder
5c27ffa42e
update to latest reedline, change config point name, enable output without ansi (#458) 2021-12-09 16:06:26 -06:00
Darren Schroeder
3dc19d4179
Filesize formatting (#456)
* configure the format of filesize

* type-o

* removed some comments

* updated tests

* accomodated filesize_metric better, added test
2021-12-09 13:19:36 -06:00
Darren Schroeder
a8e5cb871e
optionally remove table output color (#455) 2021-12-09 10:00:26 -06:00
Darren Schroeder
8d027a0617
allow decimals/floats to be formatted with precision (#449)
* allow decimals/floats to be formatted with precision

* better error message
2021-12-07 14:06:14 -06:00
Fernando Herrera
8a06ea133b
removed unwraps (#430) 2021-12-04 12:38:21 +00:00
JT
f57d629b55
Default prompt animations to off (#403) 2021-12-03 06:26:23 +13:00
JT
071066b6d9
Move prompt animation setting to config (#400) 2021-12-02 20:10:40 +13:00
Darren Schroeder
d8c721282b
add optional footer to table (#392)
* add optional footer to table

* missed a draw_table
2021-12-01 13:20:23 -06:00
Darren Schroeder
ce4d9dc7c6
allow icons to be used in grid -c (#378)
* 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
2021-11-29 14:37:09 -06:00
Darren Schroeder
250743f60f
add coloring by primitive, bring in nu-ansi-term crate (#353)
* add coloring by primitive, bring in nu-ansi-term crate

* clippy
2021-11-20 07:12:35 -06:00
Darren Schroeder
ab22619f4a
enable ls_colors for the ls command (#340)
* enable ls_colors for the `ls` command

* added wrapping with ansi-cut so the ansi sequences don't bleed over

* clippy
2021-11-15 14:09:17 -06:00
JT
0f107b2830
Add a config variable with engine support (#332)
* Add a config variable with engine support

* Add a config variable with engine support

* Oops, cleanup
2021-11-15 08:25:57 +13:00