Home Explore Blog CI



nushell

4th chunk of `blog/2022-03-22-nushell_0_60.md`
bc766a53c27fd0d99bb421e15f2eefed1c2356c0cd400f7a0000000100000902


Tables can now be configured to show a footer with the column names.

Nushell will now also respect your `LS_COLORS` environment variable if set. If it's not set, Nushell will provide a default 8-bit setting so people with color terminal can see file types in different colors as seen below in the following screenshots.

# Language improvements

There's quite a list of changes to the language itself. Let's talk about each one to help you transition to the new Nushell:

## Escape characters in strings

With 0.60, Nushell now divides strings into two types: strings with escape characters and strings without. The escaping case is written with double-quotes (`"`) and the non-escaping case is written with single-quotes (`'`):

```
> "hello\nworld"
hello
world
> 'hello\nworld'
hello\nworld
```

Nushell will prefer the single-quotes for things like path names that include spaces, allowing you to naturally write paths for Windows as well.

The difference in double-quoted and single-quoted strings also extends to interpolated strings (`$""` and `$''`):

```
> let x = 100
> $"value is:\n($x)"
value is:
100
> $'value is:\n($x)'
value is:\n100
```

## New value forms

The 0.60 release also brings with it a number of new value forms.

### Records

You now can write a record, or a list of key/value pairs, as a native data type in Nushell:

```
> {name: "Bob", age: 10}
╭──────┬─────╮
│ name │ Bob │
│ age  │ 10  │
╰──────┴─────╯
```

### Table as a list of records

With the introduction of records, a second way to define a table is a list (or stream) of records:

```
> seq 3 | each { |x| { name: Bob, x: $x } }
  #   name   x
────────────────
  0   Bob    1
  1   Bob    2
  2   Bob    3
```

### Integers are now signed 64-bit integers

We're moving away from the 'bigint' style of integers, so now integers are always signed 64-bit ints.

### Decimals are now signed 64-bit floats

Likewise, we're moving away from 'bigdecimal' to signed 64-bit float values.

### Dates

Earlier versions of Nushell supported dates as a value type, but they lacked a way to write them. You can now write a date literal in one of three ways:

Title: Nushell 0.60: Table Enhancements and Language Updates (Strings, Records, Integers, Decimals, Dates)
Summary
This excerpt discusses improvements in Nushell 0.60, including the ability to show column name footers in tables and respect the `LS_COLORS` environment variable. It details language changes such as the introduction of escaped (double-quoted) and non-escaped (single-quoted) strings, support for records as a native data type, defining tables as lists of records, transitioning to signed 64-bit integers and floats, and the addition of date literals.