nushell/crates/nu-cmd-lang/src/core_commands
JT 451a9c64d3
Change echo to print when not redirected (#10338)
# Description

This changes `echo` to work more closely to what users of other shells
would expect:

* when redirected, `echo` works as before and sends values through the
pipeline
* when not redirected, `echo` will print values to the screen/terminal

# User-Facing Changes

A standalone `echo` now will print to the terminal, if not redirected.

The `echo` command is no longer const eval-able, as it will now print to
the terminal in some cases.

# Tests + Formatting
<!--
Don't forget to add tests that cover your changes.

Make sure you've run and fixed any issues with these commands:

- `cargo fmt --all -- --check` to check standard code formatting (`cargo
fmt --all` applies these changes)
- `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used` to
check that you're using the standard code style
- `cargo test --workspace` to check that all tests pass (on Windows make
sure to [enable developer
mode](https://learn.microsoft.com/en-us/windows/apps/get-started/developer-mode-features-and-debugging))
- `cargo run -- -c "use std testing; testing run-tests --path
crates/nu-std"` to run the tests for the standard library

> **Note**
> from `nushell` you can also use the `toolkit` as follows
> ```bash
> use toolkit.nu # or use an `env_change` hook to activate it
automatically
> toolkit check pr
> ```
-->

# After Submitting
<!-- If your PR had any user-facing changes, update [the
documentation](https://github.com/nushell/nushell.github.io) after the
PR is merged, if necessary. This will help us keep the docs up to date.
-->
2023-09-13 06:35:01 +12:00
..
overlay Move Value to helpers, separate span call (#10121) 2023-09-03 07:27:29 -07:00
scope Move Value to helpers, separate span call (#10121) 2023-09-03 07:27:29 -07:00
alias.rs Uniformize usage() and extra_usage() message ending for commands helper. (#8268) 2023-02-28 21:33:02 -08:00
break_.rs Remove parser keywords label from commands that do not need it (#8780) 2023-04-07 01:12:21 +03:00
collect.rs Input output checking (#9680) 2023-07-14 15:20:35 +12:00
const_.rs Fix broken constants in scopes (#9679) 2023-07-14 00:02:05 +03:00
continue_.rs Remove parser keywords label from commands that do not need it (#8780) 2023-04-07 01:12:21 +03:00
def_env.rs remove let-env, focus on mutating $env (#9574) 2023-07-01 07:57:51 +12:00
def.rs Uniformize usage() and extra_usage() message ending for commands helper. (#8268) 2023-02-28 21:33:02 -08:00
describe.rs Move Value to helpers, separate span call (#10121) 2023-09-03 07:27:29 -07:00
do_.rs Move Value to helpers, separate span call (#10121) 2023-09-03 07:27:29 -07:00
echo.rs Change echo to print when not redirected (#10338) 2023-09-13 06:35:01 +12:00
error_make.rs Move Value to helpers, separate span call (#10121) 2023-09-03 07:27:29 -07:00
export_alias.rs Uniformize usage() and extra_usage() message ending for commands helper. (#8268) 2023-02-28 21:33:02 -08:00
export_const.rs Module: support defining const and use const variables inside of function (#9773) 2023-08-01 07:09:52 +08:00
export_def_env.rs remove let-env, focus on mutating $env (#9574) 2023-07-01 07:57:51 +12:00
export_def.rs Uniformize usage() and extra_usage() message ending for commands helper. (#8268) 2023-02-28 21:33:02 -08:00
export_extern_wrapped.rs Allow exporting extern-wrapped (#10025) 2023-08-18 20:45:33 +03:00
export_extern.rs Uniformize usage() and extra_usage() message ending for commands helper. (#8268) 2023-02-28 21:33:02 -08:00
export_module.rs Allow creating modules from directories (#9066) 2023-05-06 21:39:54 +03:00
export_use.rs Uniformize usage() and extra_usage() message ending for commands helper. (#8268) 2023-02-28 21:33:02 -08:00
export.rs Move Value to helpers, separate span call (#10121) 2023-09-03 07:27:29 -07:00
extern_.rs Custom command input/output types (#9690) 2023-07-15 09:51:28 +12:00
extern_wrapped.rs Fix example for extern-wrapped (#10004) 2023-08-14 15:41:25 +02:00
for_.rs Create Record type (#10103) 2023-08-25 07:50:29 +12:00
hide_env.rs remove let-env, focus on mutating $env (#9574) 2023-07-01 07:57:51 +12:00
hide.rs Uniformize usage() and extra_usage() message ending for commands helper. (#8268) 2023-02-28 21:33:02 -08:00
if_.rs Spanned Value step 1: span all value cases (#10042) 2023-08-25 08:48:05 +12:00
ignore.rs Allow parse-time evaluation of calls, pipelines and subexpressions (#9499) 2023-08-26 16:41:29 +03:00
lazy_make.rs Move Value to helpers, separate span call (#10121) 2023-09-03 07:27:29 -07:00
let_.rs fix input signature of let/mut (#9695) 2023-07-15 19:41:48 +12:00
loop_.rs Remove parser keywords label from commands that do not need it (#8780) 2023-04-07 01:12:21 +03:00
match_.rs Auto format let-else block (#10214) 2023-09-04 19:42:31 +12:00
mod.rs Allow exporting extern-wrapped (#10025) 2023-08-18 20:45:33 +03:00
module.rs remove let-env, focus on mutating $env (#9574) 2023-07-01 07:57:51 +12:00
mut_.rs fix input signature of let/mut (#9695) 2023-07-15 19:41:48 +12:00
register.rs Clarify how register works (#8583) 2023-03-23 13:02:22 -05:00
return_.rs allow return to return any nushell value (#10067) 2023-08-20 07:30:54 -05:00
try_.rs Change echo to print when not redirected (#10338) 2023-09-13 06:35:01 +12:00
use_.rs feat: Search terms for use, while, and range (#5093) (#10265) 2023-09-07 22:11:42 +02:00
version.rs Allow parse-time evaluation of calls, pipelines and subexpressions (#9499) 2023-08-26 16:41:29 +03:00
while_.rs feat: Search terms for use, while, and range (#5093) (#10265) 2023-09-07 22:11:42 +02:00