Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stream output from terminal commands #12

Open
Haroenv opened this issue Jan 4, 2018 · 8 comments
Open

Stream output from terminal commands #12

Haroenv opened this issue Jan 4, 2018 · 8 comments

Comments

@Haroenv
Copy link
Owner

Haroenv commented Jan 4, 2018

I did the very basics of streaming the output of execa, but not correctly I think

  1. click on a command name (there should be a "run" button next to it IMO)
  2. command starts on the server
  3. streams to frontend
  4. output continually gets shown in terminal output
  • can be done later: colouring

There should be an in-memory storage of the ran scripts, which is removed when the command is done, so .kill() can be called to the command from the frontend

@Haroenv Haroenv mentioned this issue Jan 4, 2018
4 tasks
@azz azz added the enhancement label Jan 5, 2018
@Haroenv
Copy link
Owner Author

Haroenv commented Jan 5, 2018

so it works pretty well via #14, but the colours are still flaky for some reason. Maybe it manages to miss a single packet?

@azz
Copy link
Collaborator

azz commented Jan 5, 2018

Also need to handle the move to start of line ANSI code (or just \r?)

image

@azz
Copy link
Collaborator

azz commented Jan 5, 2018

Jest looks good though - unicode problem is fixed!

image

@Haroenv
Copy link
Owner Author

Haroenv commented Jan 5, 2018

We should probably just do a newline if the command is trying to rewrite the line

@azz
Copy link
Collaborator

azz commented Jan 5, 2018

Something is awry with the ansi-html stream...

<span 0="<" 1="s" 2="p" 3="a" 4="n" 5=" " 6="0" 7="=" 8="" 9="<" 10="" 11=" " 12="1" 13="=" 14="" 15="s" 16="" 17=" " 18="2" 19="=" 20="" 21="p" 22="" 23=" " 24="3" 25="=" 26="" 27="a" 28="" 29=" " 30="4" 31="=" 32="" 33="n" 34="" 35=" " 36="5" 37="=" 38="" 39=" " 40="" 41=" " 42="6" 43="=" 44="" 45="s" 46="" 47=" " 48="7" 49="=" 50="" 51="t" 52="" 53=" " 54="8" 55="=" 56="" 57="y" 58="" 59=" " 60="9" 61="=" 62="" 63="l" 64="" 65=" " 66="1" 67="0" 68="=" 69="" 70="e" 71="" 72=" " 73="1" 74="1" 75="=" 76="" 77="=" 78="" 79=" " 80="1" 81="2" 82="=" 83="" 84="" 85=" " 86="1" 87="3" 88="=" 89="" 90="c" 91="" 92=" " 93="1" 94="4" 95="=" 96="" 97="o" 98="" 99=" " 100="1" 101="5" 102="=" 103="" 104="l" 105="" 106=" " 107="1" 108="6" 109="=" 110="" 111="o" 112="" 113=" " 114="1" 115="7" 116="=" 117="" 118="r" 119="" 120=" " 121="1" 122="8" 123="=" 124="" 125=":" 126="" 127=" " 128="1" 129="9" 130="=" 131="" 132="g" 133="" 134=" " 135="2" 136="0" 137="=" 138="" 139="r" 140="" 141=" " 142="2" 143="1" 144="=" 145="" 146="e" 147="" 148=" " 149="2" 150="2" 151="=" 152="" 153="e" 154="" 155=" " 156="2" 157="3" 158="=" 159="" 160="n" 161="" 162=" " 163="2" 164="4" 165="=" 166="" 167="" 168=" " 169="2" 170="5" 171="=" 172="" 173=">" 174="" 175=">">

@ranfdev
Copy link
Collaborator

ranfdev commented Jan 5, 2018

If i try to run a script multiple times, the stream will get slower, until the app crashes.
How to reproduce: click on the rainbow script multiple times

@Haroenv
Copy link
Owner Author

Haroenv commented Jan 5, 2018

I think the stream is actually never stopped 🤔 even though kill is called afaict

@ranfdev
Copy link
Collaborator

ranfdev commented Jan 7, 2018

I removed the theme and now i don't get any problem, check the PR #38

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants