Skip to content

Background tasks #247

Closed
Closed

Description

@sophiajt

The ability to spawn off workers while you're inside of the terminal is a natural part of working in a shell. One way nu could approach this is to be able to create a task that is worked on in the background, as part of a group of tasks.

These tasks could be killed as a group, closed on exit from the shell, etc.

One possible extension to the idea is to use #244 as a way of jumping back into a background task and interacting with its stdin/stdout.

[idea from @wycats]

Activity

  1. added
    delight
    on Aug 26, 2019
  2. andrasio commented on Nov 3, 2019

    @andrasio
    Member
  3. github-actions commented on Jun 24, 2021

    @github-actions

    This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

  4. github-actions commented on Jul 7, 2021

    @github-actions

    This issue has been marked stale for more than 10 days without activity. Closing this issue, but if you find that the issue is still valid, please reopen.

  5. dumblob commented on Jul 10, 2021

    @dumblob

    Could this be reopened? I think it's a necessary feature. I'd actually say starting with the nursery pattern (aka "structured concurrency") could make a nice MVP.

  6. github-actions commented on Oct 9, 2021

    @github-actions

    This issue is being marked stale because it has been open for 90 days without activity. If you feel that this is in error, please comment below and we will keep it marked as active. Otherwise, it will be closed in 10 days.

  7. dumblob commented on Oct 9, 2021

    @dumblob

    This should stay opened until implemented - could the robot be made to not close this automatically and if not, then maybe first in 2 years but not earlier?

  8. added a commit that references this issue on Feb 7, 2022
  9. hyiltiz commented on Aug 23, 2022

    @hyiltiz
    Contributor

    Something like luit or nq built-in would be really awesome.

  10. 27 remaining items

  11. cosineblast commented on Jan 20, 2025

    @cosineblast
    Contributor

    well, this sounds like fun. I'll give this a try and document any roadblocks I'll find, if any

  12. tmillr commented on Jan 21, 2025

    @tmillr
    Contributor

    I need this as well. I just need the ability to at least suspend one TUI application then come back to it later. I'd say start there, and then more improvements (making it work on windows, running bg tasks, multiple running or stopped tasks, etc.) can be made down the road.

  13. fdncred commented on Jan 21, 2025

    @fdncred
    Contributor

    We need to introduce features one-by-one but cross-platform. I really want to avoid adding any particular linux feature and waiting on other platforms. So, if the first feature is suspending, then I'd want it to work cross platform, then go on to the next feature. I'm fine with adding features one-by-one.

  14. cosineblast commented on Jan 21, 2025

    @cosineblast
    Contributor

    I think handling TSTP signals (i.e Ctrl-Z) can probably work well as a unix-only feature, as I believe there is no equivalent in windows.

  15. fdncred commented on Jan 21, 2025

    @fdncred
    Contributor

    SuspendThread and ResumeThread are Windows API functions. I've seen other ways of doing this too although some may be undocumented.

  16. felipesere commented on Jan 22, 2025

    @felipesere

    Im also super keen on this to keep my ctrl-Zug workflow with neovim. Happy to help test branches and PRs when they come up.

  17. felipesere commented on Jan 23, 2025

    @felipesere

    Would it make sense to go through https://www.gnu.org/software/libc/manual/html_node/Implementing-a-Shell.html and using it as inspiration be a step in the right direction? Obviously it would need porting to Rust 😂

  18. fdncred commented on Jan 23, 2025

    @fdncred
    Contributor

    I think it's a good place to learn about the details. However, there may already be a representation in Rust in the fish-shell, which was recently ported to Rust. The bigger problem is getting it to work cross-platform (windows, macos, linux). One could also review the pueue which does job mgmt and I believe is already cross-platform.

  19. delyan-kirov commented on Feb 8, 2025

    @delyan-kirov

    I would be willing to implement this functionality, as it is such a core part of my work flow and it sounds like an interesting problem. Unfortunately, I don't think I have the necessary skills to make it cross platform, I do have an idea of how it may be done for Linux specifically.

  20. fdncred commented on Feb 8, 2025

    @fdncred
    Contributor

    @delyan-kirov We need it to be cross-platform but feel free to jump into the discussion on discord. https://discord.com/channels/601130461678272522/1334407709587673141 and active PR #14883

  21. added a commit that references this issue on Feb 25, 2025
  22. WindSoilder commented on Feb 26, 2025

    @WindSoilder
    Contributor

    Finished by #14883

  23. added this to the v0.103.0 milestone on Feb 26, 2025
  24. 132ikl commented on Mar 1, 2025

    @132ikl
    Member

    For future readers, additional job control features are being tracked in #15193

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    delightstatus:needs-core-team-attention

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions