### motivation
Hi! This is something I wanted since [#14424 of
nushell/nushell](https://github.com/nushell/nushell/pull/14424) landed.
Unsorted completions on the `git checkout` command
### The problem
is that git checkout accepts lots of things: commits hashes, filenames,
local branches and remote branches. Since the mentioned pr all the
completions were sorted, but for this command it didn't make sense.
I used `git switch` to checkout a branch for the time being, but it's a
little annoying that you can't push "unsorted" completions on a command.
### the result
With the help of ysthakur and weirdan, I managed to achieve this:
```
git checkout <tab>
```
before: (these are sorted)

after: (these aren't)

### How?
Citing the docs:
https://www.nushell.sh/book/custom_completions.html#options-for-custom-completions
```
{
options: {
case_sensitive: false,
completion_algorithm: prefix,
positional: false,
sort: false,
},
completions: [cat, rat, bat]
}
}
```
and I passed **a table** to the `completions` key, instead of a _list_.
```
completions: $table_of_checkouts
```
Many (at least the ones I have encountered) env loaders replace "\n"
with a
literal newline character when loading an env variable. I need this
change in
my personal config and I think others would also prefer this default.
I removed `gstat` plugin dependency need by replacing the command.
~~The only problem is that the aliases don't work for the current
nushell version~~
Done!
fixes#973 and closes#974
Hi! I realized if you use worktrees, with at least one branch checked
out and you:
```
git switch <tab>
```
the autocompletion is wrong, putting a `+ ` before the branch, and
piping it into the cmdline.
This comes from `nu-complete git local branches` function, it which it
only replaces `* ` for the current branch, but it doesn't for `+ ` for
worktrees.
Here is a sample:

I tested on my pc and works allright!
This remove a duplicate: the `--no-edit` was there twice in the "git
commit" command completion.
After my change, the only remaining `--no-edit` is at line 455.
Previously, panache-git included a prompt indicator (`> `) out of the
box, and the advice for the user was to remove Nushell's own
configurable prompt indicator by setting it to the empty string.
However, this conflicted with some of Nushell's intended functionality,
such as the ability to use a different prompt indicator in each vi mode.
With this change, panache-git does not include a prompt indicator. The
advice is for the user to use the prompt indicator they like, but to
reset the color so it better matches panache-git's colors.
This is something of a breaking change, in that users who update to the
latest panache-git.nu without making corresponding changes to their
Nushell config might see two prompt indicators (`> > `), but my hope is
that giving users (especially vi mode users) more flexibility with their
prompt indicators will be worth any temporary confusion.
Extends #1002. Renames `path replace-extension` to `path
with-extension`, in following with other languages
([Rust](https://doc.rust-lang.org/std/path/struct.Path.html#method.with_extension),
[Python](https://docs.python.org/3/library/pathlib.html#pathlib.PurePath.with_suffix)),
and adds `path with-stem` and `path with-parent`. Also moves the `path`
module into `std-rfc` so it can be used like `use std-rfc/path`.
Adds a private helper function, `with-field`, that `with-extension`,
`with-stem`, and `with-parent` can use. These can each be dead simple
functions, while giving users more options for path manipulation.
The motivation for separate `with-extension`, `with-stem`, and
`with-parent` functions, rather than a more general function like `path
with` is the following:
- `with-extension` has special behavior for stripping periods
- you can tab-complete `path with<TAB>` to immediately see all the
possible options
- you can't accidentally pass an invalid field to `path with`
- there can be separate examples for `with-extension`, `with-stem`,
`with-parent` for only the relevant functionality
# Description
Add `clip copy` and `clip paste` for interacting with system clipboard,
making use of OSC 52.
I'm not sure how to write tests for these commands.
> [!TIP]
> No platform specific external binary is required.
> [!WARNING]
> - Not all terminal emulators will support this
> - Terminal multiplexers may interfere with it, depending on their
configuration.
# Related
- https://github.com/nushell/nushell/pull/11131
- https://github.com/nushell/nu_scripts/pull/674
Adds `path replace-extension` as requested in https://github.com/nushell/nushell/issues/14144
Also sets up testing for candidates. In order to do this, I made
some changes:
1. ported `nu-std/testing.nu` under `stdlib-candidate` folder, and
making some changes.
2. run candidate tests in `toolkit check pr` command, to make sure the
test is run in CI.
3. including `stdlib-candidate` to `NU_LIB_DIRS` when running lint, so
the tests can pass linter.
Changes in stdlib-candidate/testing.nu:
1. remove `std/log` usage
2. including `stdlib-candidate` path in `run-test` command
Nitpick, but I've noticed it a few times so figured I'd just go ahead
and get rid of it.
* Mainly, removed the comment about changing the hardcoded 30-width
terminal since it's now handled dynamically (at least in this module)
* Also removed references to engine-q
I notice there are a lot of other engine-q references when I grep
`nu_scripts`, but I'll leave those for another day. Some of those are
probably pretty outdated (e.g., `init.nu` in the example config) and
need to be culled.
heres the changes
- Removed outdated code
- Replaced the old load-env with $env assignment
- Kept the rbenv command intact but focused on the "rbenv shell"
(modified a subcommand rather than the whole command)
- Deleted unused command completions
A quick update to allow the oh-my.nu prompt to respect the
$env.config.use_ansi_coloring by way of a new command called `config
use-colors`. This way the prompt will be rendered correctly as far as
ansi escapes.
This file was also formatted with `topiary` which makes up for the rest
of the changes.
This will only work on nushell version 0.101.1 and above.
When I updated nu to 101, the completions of poetry failed because of a
missing `:`
this
```nu
def "nu-complete poetry python-versions" [] nothing -> list<string> {
```
for this
```nu
def "nu-complete poetry python-versions" []: nothing -> list<string> {
```
Fixed a couple of places and some other parser issues
- [x] fixed typo: `table-of-content` in the backreference
- [x] missing sanitization of `_`,`+`,`.`,`?` etc.
- [x] handling the confusion of h1 `#` and comment `#`
Since 0.101.0 we will finally catch more illegal `def` signatures. As
the grammar for input/output types is rather restricted, this would
error otherwise
Noticed an issue in `conda.nu`.
It modified `$env.PATH` from list of string to a string, without
**expanding** it. It may be a problem if I have a path which is
relative:
```nushell
$env.PATH = ($env.PATH | split row (char esep) | prepend '~/.cargo/bin')
```
After activating an env, it's impossible to find executables in
`~/.cargo/bin`. So this pr is going to make sure the path is expanded
while converting.
For more context:
https://github.com/nushell/nushell/pull/14615?notification_referrer_id=NT_kwDOAVOaGrQxMzkwODcxMjU3NjoyMjI1NjE1NA#issuecomment-2552696978
Sometimes, we have so many SSH servers that divide to extra config files
and include in *~/.ssh/config*
This PR follow the `Include` directive to retrieve more hosts.
Example of such config:
```ssh_config
Include extra/agriconnect
Include "extra/Old servers"
```
This PR also fix an issue that orginal code grabs this:
```ssh_config
Host *
```
i get the following LSP error in my editor, because it's true `main`
does not return a `string` 🤔

in this PR, i propose to truely return `nothing` from this _main_
command by `print`ing the help page.
### alternative
we could also change the signature to `nothing -> string`
The `-b`, that outputs the value as binary, has been removed as it is
now the default behaviour.
```sh
"U29tZSBEYXRh" | decode base64 2024-10-20 20:56:15
Length: 9 (0x9) bytes | printable whitespace ascii_other non_ascii
00000000: 53 6f 6d 65 20 44 61 74 61 Some Data
```
Docs: https://www.nushell.sh/commands/docs/decode_base64.html
I'm here to fix the mistake that I made with the Yadm module.
I removed completions in favor of just scripts.
I also added a way to install yadm as well.
From https://github.com/nushell/nushell/issues/13887, this adds:
```nu
into list
select ranges
select column-ranges
reject ranges
reject column-ranges
row-indices
col-indices
```
Note that these replace the former `get-row` and `get-col` commands that
were in the library. They have the same functionality and can accept any
combination of:
* One or more row or column indices
* One or more row or column ranges
I haven't been through all of them yet, and some of those that I have
reviewed still have useful info that should be preserved. However, this
`logging.nu` version seems to long predate the one we now have in the
standard-library.