You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It may not be possible, but this here is a pretty good start:
varchild_process=require("child_process");Barcli.prototype.update=function(data){varposition=getPosition();// Update the bar// Restore to original positionprocess.stdout.write("\033["+position.row+";"+position.column+"H\033[?25h");});functiongetPosition(){varoutput=child_process.execSync("exec < /dev/tty\noldstty=$(stty -g)\nstty raw -echo min 0\necho \"\\033[6n\" > /dev/tty\n\nIFS=\';\' read -r -d R -a pos\nstty $oldstty\nrow=$((${pos[0]:2}))\ncol=$((${pos[1]}))\necho \\{\\\"row\\\":$row, \\\"column\\\":$col\\}");returnJSON.parse(output.toString());};
Right now hitting any key causes the shell script to fail.
Other big problem to solve is how do we keep track of where our barcli graph is as the window scrolls?
Maybe it's possible to read each line in the window and find the bar if it's visible.
The text was updated successfully, but these errors were encountered:
dtex
changed the title
Retain the ability to write to stdout and use the REPL
Retain the ability to write to stdout and use the REPL while still updating a bar
Aug 2, 2017
It may not be possible, but this here is a pretty good start:
Right now hitting any key causes the shell script to fail.
Other big problem to solve is how do we keep track of where our barcli graph is as the window scrolls?
Maybe it's possible to read each line in the window and find the bar if it's visible.
The text was updated successfully, but these errors were encountered: