Commit Graph

185 Commits

Author SHA1 Message Date
Barnaby Keene
0412c3a2f8 fix: remove the additional characters from highlighter
This resolves a small integration issue that would make custom prompts problematic (if they are implemented). The approach was to use the highlighter implementation in Helper to insert colour codes to the prompt however it heavily relies on the prompt being in a specific format, ending with a `> ` sequence. However, this should really be the job of the prompt itself not the presentation layer.

For now, I've simply stripped off the additional `> ` characters and passed in just the prompt itself without slicing off the last two characters. I moved the `\x1b[m` control sequence to the prompt creation in `cli.rs` as this feels like the more logical home for controlling what the prompt looks like. I can think of better ways to do this in future but this should be a fine solution for now.

In future it would probably make sense to completely separate prompts (be it, internal or external) from this code so it can be configured as an isolated piece of code.
2019-10-08 21:39:58 +01:00
Barnaby Keene
fb8cfeb70d feat: starship prompt
Kind of touches on #356 by integrating the Starship prompt directly into the shell.

Not finished yet and has surfaced a potential bug in rustyline anyway. It depends on https://github.com/starship/starship/pull/509 being merged so the Starship prompt can be used as a library.

I could have tackled #356 completely and implemented a full custom prompt feature but I felt this was a simpler approach given that Starship is both written in Rust so shelling out isn't necessary and it already has a bunch of useful features built in.

However, I would understand if it would be preferable to just scrap integrating Starship directly and instead implement a custom prompt system which would facilitate simply shelling out to Starship.
2019-10-08 16:25:12 +01:00
Jonathan Turner
7113c702ff
Merge pull request #706 from landaire/ctrlc_config
feat(cli): add `ctrlc_exit` config option
2019-09-26 09:22:11 +12:00
Lander Brandt
0377efdc16 feat(cli): add ctrlc_exit config option
This feature allows a user to set `ctrlc_exit` to `true` or `false` in their config to override how multiple CTRL-C invocations are handled. Without this change pressing CTRL-C multiple times will exit nu. With this change applied the user can configure the behavior to behave like other shells where multiple invocations will essentially clear the line.

This fixes #457.
2019-09-24 18:04:53 -07:00
Pirmin Kalberer
3480cdb3b4 Fix build without crossterm 2019-09-24 23:33:30 +02:00
Andrés N. Robalino
898b99d7c2 Ignore incompatible plugins and continue plugin search. 2019-09-23 17:27:18 -05:00
Andrés N. Robalino
95ea3fcf4e Load plugin if and only if it hasn't been registered. 2019-09-23 17:01:40 -05:00
Pirmin Kalberer
9623a255c4 Include history path in env command 2019-09-20 10:37:05 +02:00
Pirmin Kalberer
484d8c26ac Save history when leaving with Ctrl-C 2019-09-19 22:55:53 +02:00
Pirmin Kalberer
df7a3a4863 Store history.txt in user data path 2019-09-19 22:29:11 +02:00
Pirmin Kalberer
d7e7f48aaa Deactivate fuzzy search on Windows for now 2019-09-19 20:45:58 +02:00
Pirmin Kalberer
0a0be19bed Rename histsearch to fuzzysearch 2019-09-19 20:18:39 +02:00
Pirmin Kalberer
1c95bf05dc Process selected command 2019-09-19 20:18:39 +02:00
Pirmin Kalberer
1e3549571c Bind fuzzy history search to Ctrl-R 2019-09-19 20:18:39 +02:00
Jonathan Turner
5ff94004c6 Add urlencode/urldecode 2019-09-19 16:25:29 +12:00
Jonathan Turner
f6b82e4c0c Replace vtable with pivot command 2019-09-17 19:07:11 +12:00
Jonathan Turner
7fbd6ce232 Fix internal paths 2019-09-17 14:09:15 +12:00
Jonathan Turner
17855d37a4 Add env command 2019-09-16 19:52:58 +12:00
Andrés N. Robalino
6bb277baaa
Merge pull request #668 from nushell/span-to-tag
Span to tag
2019-09-14 15:10:04 -05:00
Jonathan Turner
2b88f1eed0 Serialize bigint/bigdecimal as i64/f64 2019-09-15 05:48:24 +12:00
Yehuda Katz
ab915f1c44 Revert "Revert "Migrate most uses of the Span concept to Tag""
This reverts commit bee7c5639c.
2019-09-14 11:30:24 -05:00
Andrés N. Robalino
d0d56deaf1 Permit Nu finding and picking up development plugins if there are any first. 2019-09-12 18:49:29 -05:00
Andrés N. Robalino
e4ed8c94ad dot character is valid in Windows plugin binaries. 2019-09-12 02:20:22 -05:00
Andrés N. Robalino
c57c0eb371 pass lint checks. 2019-09-12 01:49:01 -05:00
Andrés N. Robalino
b35549adac Removes regex crate dependency. 2019-09-11 22:20:42 -05:00
Jonathan Turner
bee7c5639c
Revert "Migrate most uses of the Span concept to Tag" 2019-09-11 19:53:05 +12:00
Yehuda Katz
58b7800172 Migrate most uses of the Span concept to Tag
Also migrate mv, rm and commands like that to taking a
SyntaxType::Pattern instead of a SyntaxType::Path for their first
argument.
2019-09-10 20:41:03 -07:00
Jonathan Turner
448b1a4848 Make some plugins optional, move ps to plugin 2019-09-08 19:06:15 +12:00
Jonathan Turner
4cdaed1ad4 Add echo command 2019-09-08 11:43:53 +12:00
Pradeep Chhetri
ee301f9f54 Adds pwd command 2019-09-07 23:53:56 +08:00
Jonathan Turner
dcd97b6346 Move internal terminology to tables/rows 2019-09-06 04:23:42 +12:00
Jonathan Turner
479f0a566e Covert to_* commands to work on whole table 2019-09-04 18:48:40 +12:00
Jan Koprowski
ab97459d0e Stop printing CTRL-D on EOF 2019-09-03 21:40:42 +02:00
Jonathan Turner
8a9cdcab17 Split fetch command away from open 2019-09-03 18:04:46 +12:00
Yehuda Katz
7fa09f59c2 Remove unused code
Closes #467
2019-09-01 23:11:05 -07:00
Jonathan Turner
7d46f9e860 Another attempt to fix the zombie processes 2019-09-02 04:45:30 +12:00
Andrés N. Robalino
ca0c6eaf58 This commit introduces a basic help feature. We can go to it
with the `help` command to explore and list all commands available.

Enter will also try to see if the location to be entered is an existing
Nu command, if it is it will let you inspect the command under `help`.

This provides baseline needed so we can iterate on it.
2019-08-31 19:06:11 -05:00
Jonathan Turner
1a67ac6102 Random fixes 2019-09-01 09:19:59 +12:00
Jonathan Turner
1d77595576 Merge branch 'master' into post 2019-08-31 15:12:03 +12:00
Jonathan Turner
2cec8168c7 Merge master 2019-08-31 13:30:41 +12:00
Patrick Meredith
3d147d1143 Add SQLite support 2019-08-30 20:54:45 -04:00
Jonathan Turner
fa2c6ec227 Merge master 2019-08-31 10:13:09 +12:00
Jonathan Turner
9e167713b3 Add post command 2019-08-31 06:27:15 +12:00
Jonathan Turner
729051fdd2
Merge pull request #407 from iamcodemaker/vi
WIP: add support for vi mode
2019-08-30 15:54:30 +12:00
Taiki Endo
58a32490c5 Remove usage of in_band_lifetimes feature 2019-08-30 01:32:31 +09:00
est31
c87fa14fc8 Replace crate visibility identifier with pub(crate)
Result of running:

find src -name *.rs -exec sed -i 's/crate /pub(crate) /g' {} \;
2019-08-29 13:09:09 +02:00
Andrés N. Robalino
f1e8c433c2 [from/to]tsv support. 2019-08-29 04:02:16 -05:00
Jonathan Turner
f730296e45 WIP supporting from/to automatically 2019-08-29 15:53:45 +12:00
Jonathan Turner
4576570275
Merge pull request #520 from est31/remove_try_trait
Remove try_trait feature use
2019-08-29 14:46:53 +12:00
est31
012d8f3d6f Remove try_trait feature use 2019-08-29 03:12:10 +02:00