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

Add new background commands #1546

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

causand22
Copy link
Contributor

Adding cli commands to view the status of background shell commands. When a call to background [cmd] is executed, mm stores the associated command alongside a sequential ID and some information (time start, time end, stdout, stderr, running). When the process exits, the stdout and stderr outputs are saved and the process is marked as complete. Users can then grab the stdout or stderr of a completed process. There is a limit of 50 background processes stored in the status table. When the 51st is created, the oldest (sorted by time of the process ending) will be removed from the table and stdout / stderr can no longer be accessed using background-output. All outputs of background processes are also logged to the logger on level info.

Commands changed:

  • background
    • Now returns an ID for the background process. Creates an entry in the background process table.

Commands added:

  • background-status [id]
    • Get the status of all the background processes in a tabular format.
    • If id is provided, only return the status of that entry (if exists)
  • clear background-status
    • Deletes all background processes from the table that are done running (freeing up memory for saved stdout/stderr)
  • background-output <id>
    • Get raw stdout from a specific background process
  • background-error <id>
    • Get raw stderr from a specific background process

adding background commands
@jacdavi jacdavi self-requested a review November 22, 2024 19:17
@jacdavi jacdavi added this to the 2.10 milestone Dec 2, 2024
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

Successfully merging this pull request may close these issues.

2 participants