Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

coreutils + pipe doesn't work #4

Open
ShellCode33 opened this issue Jun 25, 2019 · 3 comments
Open

coreutils + pipe doesn't work #4

ShellCode33 opened this issue Jun 25, 2019 · 3 comments
Labels
bug Something isn't working

Comments

@ShellCode33
Copy link

ShellCode33 commented Jun 25, 2019

Hi ! I'm new to xonsh and I find it truly amazing ! So first of all, thanks for doing it :)

I've enabed the coreutils plugin to speed things up a little, but I've noticed that when you redirect the stdout of a program into the stdin of a coreutils' function, it doesn't work at all and the shell keeps printing xonsh: readline() takes no keyword arguments until you ctrl+c.
Command to reproduce : echo test | cat
Of course, the following works great : echo test | /usr/bin/cat

I'm not familiar at all with xonsh code, but wouldn't it be possible to use the binary instead of the builtin when a pipe is used ? Or to consider stdin in coreutils ?

Here is my config :

+------------------+---------------------+
| xonsh            | 0.9.6               |
| Git SHA          | dabd4bd3            |
| Commit Date      | Jun 6 09:44:17 2019 |
| Python           | 3.7.3               |
| PLY              | 3.11                |
| have readline    | True                |
| prompt toolkit   | 2.0.9               |
| shell type       | prompt_toolkit2     |
| pygments         | 2.4.2               |
| on posix         | True                |
| on linux         | True                |
| distro           | unknown             |
| on darwin        | False               |
| on windows       | False               |
| on cygwin        | False               |
| on msys2         | False               |
| is superuser     | False               |
| default encoding | utf-8               |
| xonsh encoding   | utf-8               |
| encoding errors  | surrogateescape     |
+------------------+---------------------+

For community

⬇️ Please click the 👍 reaction instead of leaving a +1 or 👍 comment

@ShellCode33
Copy link
Author

ShellCode33 commented Jun 26, 2019

I should probably create a new issue for this, but since it's still cat related...
I found another bug : reading files from /proc doesn't show anything.

$ cat /proc/cpuinfo                                                                                                                                                                            
$ /usr/bin/cat /proc/cpuinfo                                                                                                                                                                   
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 60
model name      : Intel(R) Core(TM) i5-4590 CPU @ 3.30GHz

I have no clue why this is happening... Maybe something to do with the fact that /proc files are in RAM ?

@laloch
Copy link
Member

laloch commented Jun 26, 2019

Hi @ShellCode33, thanks for reporting! I can confirm both the issues. Could you please file another report for the second bug? It seems that cat is currently unable to fetch contents of zero-sized pseudo-files. These two are unrelated.

@laloch laloch added the bug Something isn't working label Jun 26, 2019
@ShellCode33
Copy link
Author

Done xonsh/xonsh#3182 !

@anki-code anki-code transferred this issue from xonsh/xonsh Feb 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants