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
Well hi.
I'm trying to make a progress bar using the edit-line command, but instead of modify the last line that was printed adds a new line or doesn't do anything. It surely is something im doing wrong, or i missunderstood the function of edit-line.
I've modified the code a lot, but this is the function that i have now:
let progressStatus = 0 /// to know if its the first time that executes or not
function progress(cmd){ /// the progress bar string is drawed outside and sent via cmd
if(cmd === "done"){ /// if the progress bar finished
progressStatus = 0 /// reset the status flag
} else{ /// if not
if(progressStatus === 0){ /// if its the first time that the function is executed
Terminal.terminalObj.printToActive(cmd) /// send the first line with printToActive
progressStatus = 1; /// turns flag on
} else{ /// if its not the first time
Terminal.terminalObj.runCommandOnActive(`edit-line ${cmd}`) /// update the last line
}
}
}
//// The terminalObj is obtained inside the Terminal class with this
ref={(terminal) => { Terminal.terminalObj = terminal; }}
Any help will be apreciated.
Thanks.
The text was updated successfully, but these errors were encountered:
Well hi.
I'm trying to make a progress bar using the edit-line command, but instead of modify the last line that was printed adds a new line or doesn't do anything. It surely is something im doing wrong, or i missunderstood the function of edit-line.
I've modified the code a lot, but this is the function that i have now:
Any help will be apreciated.
Thanks.
The text was updated successfully, but these errors were encountered: