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

Highlight crashed processes in red #125

Closed
srid opened this issue Jan 12, 2024 · 7 comments
Closed

Highlight crashed processes in red #125

srid opened this issue Jan 12, 2024 · 7 comments

Comments

@srid
Copy link
Contributor

srid commented Jan 12, 2024

Feature Request

If a process exits with non-zero exit code, highlight that process line in RED colour or something. This catches the user's attention more readily than when they have to linearly (O(n)) scan the "EXIT CODE" column manually.

Use Case:

In the setup below, both the pg-basebackup-* processes exited unsuccessfully. (How quickly can your eyes land on them?)

image

Proposed Change

Highlight the pg-basebackup-* processes in different colour (red) to visually indicate that they crashed.

Who Benefits From The Change(s)?

Everyone, especially those who use process-compose to run more than a handful of processes.

Alternative Approaches

None that I can think of.

@srid
Copy link
Contributor Author

srid commented Jan 12, 2024

Implementation tip:

pv.procTable.SetCell(r+1, 7, tview.NewTableCell(strconv.Itoa(state.ExitCode)).SetAlign(tview.AlignRight).SetExpansion(0).SetTextColor(tcell.ColorLightSkyBlue))

@F1bonacc1
Copy link
Owner

Great! I will add it to the next release.

While I am at it, do you have any recommendations for additional color based hints for other states, like completed and pending?

@stijnveenman
Copy link
Contributor

stijnveenman commented Jan 12, 2024

This is also something I've recently thought about since we had a similar need.

One thing I personally would like to see is a status icon column (for example with just the ASCII char ) and giving that a color, instead of highlighting the entire row. This might improve accessibility/readability on colors.

For me, i'd like to see the following colors:

  • pending: gray
  • completed with exit code: 0: green
  • non exit code 0: red
  • running: blue
  • unhealthy: yellow

@F1bonacc1
Copy link
Owner

F1bonacc1 commented Jan 12, 2024

@stijnveenman I like your suggestion!
Considering color-blind people, maybe it will be better also to use a unique icon for each state?
Something like this:
image

@F1bonacc1
Copy link
Owner

Added in v0.80.0
@stijnveenman I implemented your initial suggestion - it looks cleaner to me.
The lack of uniformity between the icon (ASCII chars) styles bugged my OCD too much :)
As for the color-blind people, the state can be inferred from the text as well.

@srid
Copy link
Contributor Author

srid commented Jan 14, 2024

@F1bonacc1 Nice!

This is what it looks like, btw.

  • I'm curious why 'skipped' is in yellow. Yellow makes sense for 'not ready' as a warning state. Is skipped a warning state?
image

srid added a commit to nammayatri/common that referenced this issue Jan 14, 2024
@F1bonacc1
Copy link
Owner

Hi @srid,
I am always open to feedback; if something can be improved, I am all for it.
Skipped means one of the 2 failed states:

  1. Process A waited for B to finish with exit code 0, but it didn't.
  2. Process A waited for B to become ready but B finished without becoming ready.

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

No branches or pull requests

3 participants