websockets / wscat

WebSocket cat
MIT License
2.25k stars 223 forks source link

Preserve cursor on input line and display received messages from the line start. #123

Closed mahdi-shojaee closed 4 years ago

mahdi-shojaee commented 4 years ago

Thanks for this useful tool. Currently, we cannot type correctly while receiving messages from the server. With each message received from the server, the current cursor position will reset. Received messages also not displaying correctly.

Connected (press CTRL+C to quit)
    < tick
 < tick
     < tick
    < tick
    < tick
   < tick
     < tick
    < tick
    < tick
> .erverrom sages fmessving receiwhile g typin

This PR fixed these two bugs also mentioned in Issues #46 and #84. The new output is this:

Connected (press CTRL+C to quit)
< tick
< tick
< tick
< tick
< tick
< tick
< tick
< tick
< tick
< tick
> typing while receiving messages from the server.
lpinca commented 4 years ago

Thank you.