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

Make the cmdrunner more interactive #680

Merged
merged 2 commits into from
Oct 9, 2019
Merged

Make the cmdrunner more interactive #680

merged 2 commits into from
Oct 9, 2019

Conversation

noxer
Copy link
Contributor

@noxer noxer commented Oct 7, 2019

Currently the cmdrunner executes the command once for each update interval which delays the update for other widgets and prevents users from using longer running commands (like watching a log or requesting data from very slow servers). This PR fixes the problem by running the command concurrently and updating the view each time the command outputs data.

It also adds two config parameters:

  • tail which causes the widget to scroll to the end of new output (interesting for following log files)
  • maxLines which limits the number of lines kept in the buffer (to prevent the widget from consuming unlimited memory)

Also the widget is now focusable to allow the user to scroll in the output.

@noxer
Copy link
Contributor Author

noxer commented Oct 7, 2019

I've tested the new runner with dmesg on Linux.

    dmesg:
      args: ["--color=always", "-w"]
      cmd: "dmesg"
      tail: true
      enabled: true
      maxLines: 100
      position:
        top: 0
        left: 1
        height: 4
        width: 2
      refreshInterval: 30
      type: cmdrunner

@senorprogrammer
Copy link
Collaborator

Looks good!

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

Successfully merging this pull request may close these issues.

2 participants