Hacker Newsnew | past | comments | ask | show | jobs | submit | basicer's commentslogin

We do!


Neat! We were actually considering doing something like this with custom CSI sequences. Glad to see someone else has already picked some sensible ones.


SSH only separates the streams when you don't request a PTY. For example try:

  ssh localhost -t 'echo hi 1>&2'  2>test
vs

  ssh localhost 'echo hi 1>&2'  2>test


We tried something like this. Minimal was still confusing a non-trivial percentage of the time. Testing locally it was around 0.9%, but in production under docker where execution is constrained to a single core, it seemed to happen much more often.

It is really confusing to the user to have the prompt in the middle of their output.


Interesting. I guess the specific issue with the prompt could be fixed by always printing data from the stderr pipe first, but then you probably get incorrect ordering in other cases...


You can actually set an environmental variable with any color code you want: STDERRED_ESC_CODE. As for color codes in stderr, they work in most cases. If all the color codes are in a single write(), it will more or less be unaffected by the extra red and reset color codes that get stuck on either end.


Not sure what update-initramfs does exactly, but if you ever close(2) your going to be in a world of hurt, because the next file you open is going to have a bunch of junk written to it.

At repl.it we don't put it in our .bashrc or anything like that, we call the wrapper program manually when we launch the user's binary.


Not normally, no. The file descriptors sort of act like pointers. During normal execution in a pty, stdrr and stdout both point to the same device with the same buffer. Nothing is handling the order because there is only one buffer being written to.


> Nothing is handling the order because there is only one buffer being written to.

Ah, that's what I was missing. Thank you, that makes sense.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: