nushell/crates/nu-utils
Antoine Stevan 22142bd4ae
add a cross platform clip command to the standard library (#8695)
Should close the associated poin in #8311

# Description
this PR adds a `clip` command to `std` which
- has error support in case the clipboard system command is not
installed
- removes any ANSI escape sequences from the input to have a clean
copied text
- can throw desktop notifications on linux in case of a long pipeline
which needs to be copied (can be disabled with `--no-notify`)
- echoes the copied data to the output of the terminal (can be disabled
with --silent)
- has examples and dependencies listed
- has "charpage" 65001 (a.k.a. utf-8) support for windows

## new additions from 9cd3c951f to
ad3e8de25b
- better OS context error support
- use of the `match` statement for scalability
- `match` the value of the `$nu.os-info.name`
- add `macOS` with `pbcopy` to the list of supported systems
- throw an error when the OS is not supported
- ~~add simple tests to make sure `clip` works on all main OSes with the
CI~~ had to be removed in 6028b98483 (see
[the failing
test](https://github.com/nushell/nushell/actions/runs/4610091544/jobs/8148126550?pr=8695#step:6:35))

# User-Facing Changes
users can now access a `clip` to copy the output of any pipeline to the
system clipboard, on any system

# Tests + Formatting
```
$nothing
```

# After Submitting
```
$nothing
```
2023-04-05 13:19:42 -05:00
..
src Change default config to display failed LAST_EXIT_CODE (#8735) 2023-04-05 13:06:24 -05:00
standard_library add a cross platform clip command to the standard library (#8695) 2023-04-05 13:19:42 -05:00
.gitignore added nu-utils crate, fixed issue where externals turn off vt processing (#4857) 2022-03-16 17:21:06 -05:00
Cargo.toml Bump to 0.78.1 development version (#8741) 2023-04-05 13:36:10 +12:00
LICENSE Fix rest of license year ranges (#8727) 2023-04-04 09:03:29 +12:00