eliihen / wsta

A CLI development tool for WebSocket APIs
GNU General Public License v3.0
631 stars 19 forks source link

Navigate through the input using arrows #16

Open AlexKMDev opened 7 years ago

AlexKMDev commented 7 years ago

Currently it's not possible, because wsta doesn't handle arrow keys in any way (i.e. it inserts ^[[D and ^[[C instead of navigating). It would be more convenient for editing input text.

eliihen commented 7 years ago

This would require creating some sort of "input mode" when the program detects that it is not reading from a pipe, but from a tty. It's not a trivial change. Right now it only reads from stdin to be as pipe-friendly as possible, and that will never change. But implementing this for ttys only sounds fair

One way to edit input text in the terminal right now:

echo 'input text' | wsta

An alternative is to use wscat, which is built with a different philosophy. It is not pipe friendly, but is more of a "terminal" into the websocket connection, which sounds like is what you want.