3 ms·
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?
by forbes 6y ago
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?
- kbd 6y agoless is a program, why can’t you use it from nu?
- forbes 6y agoIf 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.
- eigenrick 6y agoThe 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!
- forbes 6y agoThe 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.