tigrawap / slit

slit - a modern PAGER for viewing logs, get more than most in less time

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Reading file doesn't work when piping the text command into bash

idanarye opened this issue · comments

$ slit --version
Slit Version:  1.1.6

This bug may only occur in my particular usecase, but it may indicate something deeper. I'm piping commands to bash, and then to cat so I can post the result here - but the same thing happens without cat(see or not see the text in the less/slit TUI).

Echoing into slit works fine:

$ echo 'echo foo | less' | bash | cat
foo
$ echo 'echo foo | slit' | bash | cat
foo

But, if I try to read a file, it doesn't work with slit - even though it works with less:

$ echo foo > foo.txt
$ echo 'less foo.txt' | bash | cat
foo
$ echo 'slit foo.txt' | bash | cat
$

If I invoke the command directly instead of piping it's text into bash it works fine:

$ less foo.txt | cat
foo
$ slit foo.txt | cat
foo

So... what's the difference?

Well, now I know that less ignores stdin if filename provided :)