Closed minecraftchest1 closed 3 years ago
It's not hard to add \r to bots. :) There have been dozens of bots written.
\r\n allows for terminals to work, and we're not going to break everything at this point, sorry.
That was quick.
Any idea on how to get commands like this to work?
tail -f in.txt | java -Xms1024m -Xmx1024m -jar server.jar | tee out.txt | sed '/[^\r]$/{N; s/\n/ /}' | ssh minecraft@192.168.1.40 -p 2022 -T > tmp.txt
Could use something like unix2dos
(typically under the dos2unix
package).
With sed, you probably want sed s/$/\r/
More here: https://unix.stackexchange.com/questions/153091/how-to-add-a-carriage-return-before-every-newline
Btw you can get cleaner output if you're using our "bot" API. It's under-documented though: https://github.com/shazow/ssh-chat/issues/104#issuecomment-615348534
If you figure it out, a wiki page with a short tutorial would be really appreciated!
Could use something like
unix2dos
(typically under thedos2unix
package).With sed, you probably want
sed s/$/\r/
More here: https://unix.stackexchange.com/questions/153091/how-to-add-a-carriage-return-before-every-newline
Searched on bing, but didn't find that answer. Thanks. This thread might still be of some use for some people sitll :)
Currently, ssh.chat sends messages when a carriage return newline (\r\n) is sent. This behavior makes it hard to make bots that send output from command line apps that send just \n (essentially any non-windows apps).