News for hackers. Stuff that matters.
Re:One Year of Nushell by forbes on Tuesday August 25, 2020 @12:48AM (#24268194)
This seems very interesting. After a quick play I cannot find anything similar to 'less' which I use very frequently. Is there a nushell equivalent?
Re:One Year of Nushell by eigenrick on Tuesday August 25, 2020 @11:02AM (#24272029)
The equivalent is called `textview` which is a built-in which tries to be a bit more intelligent than `less` with regard to file-types.

The default viewer, which sort of runs at the end of every pipeline is called `autoview`.

Now.. autoview should be calling textview in the cases where the pipeline detects a large text value. It is possible that you're not exactly running a pipeline.

For instance: If you run:

    cat big.log
it is not running a pipeline, just an external command.

If you run:

    open big.log

 you're invoking nushell's mechanism for creating a pipeline sourced by the contents of big.log.  You should also notice that textview is invoked, because there should be a pager. 

Alternatively, you can choose to create a pipeline by pipe-ing the output of cat big.log into something. If you pipe it to textview you should see the same result:

    cat big.log | textview 
Hope that helps!
Re:One Year of Nushell by forbes on Thursday August 27, 2020 @01:01AM (#24290270)
The command that I was trying to use was 'ls', which doesn't seem to play with textview when I try it out 'ls | textview' (just no output at all). textview does work for me with files, as in your example.
Re:One Year of Nushell by kbd on Tuesday August 25, 2020 @01:29AM (#24268360)
less is a program, why can’t you use it from nu?
Re:One Year of Nushell by forbes on Tuesday August 25, 2020 @04:54AM (#24269375)
If you use less with a filename, it will work. I normally pipe things to less which doesn't seem to work for me in nu. less shows an empty input.

This is possibly me just doing something wrong.

Re:One Year of Nushell by kbd on Wednesday August 26, 2020 @11:52AM (#24283596)
`cat notes.txt | less` works fine for me in nu 0.18.1
Re:One Year of Nushell by scns on Tuesday August 25, 2020 @10:00AM (#24271420)
Maybe file an issue?