Skip to content

job kill should take multiple arguments, and where is foreground and wait? #17431

@xpusostomos

Description

@xpusostomos

Basics

  • I have done a basic search through the issue tracker to find similar or related issues.
  • I have made myself familiar with the available features of Nushell for the particular area this enhancement request touches.

Related problem

The UNIX way has always been that commands generally take unlimited arguments. That's how it is with bash's kill. Plus I want to be able to do something like...

job kill ...(job list | get id | echo $in)

which I can't do now because job kill only takes one argument.

As another point, I'm super confused about nushell job control. job unfreeze says it puts a frozen job into the foreground, so how do I unfreeze a frozen job into the background? Aka the bash "bg" command? it's not spawn, that creates a new process, not unfreezing an existing one. It doesn't seem to be an option, which makes the whole system very bizarre in my mind. nushell seems confused about whether it wants to adopt unixy terminology, or to flagrently disregard it. Why is it unfreeze and not "foreground"? Why isn't there a "job background" ?

Speaking of missing features, where is "job wait" command ? Wait is also one of the core shell job control commands that is also missing.

It remains odd to me that nushell "hijacks" common unix commands like ps, find, echo etc... which it also does for kill, as a nushell builtin... but kill doesn't take job ids, only pids. so we also have job kill But we don't have wait, or job wait. Would it be so terrible if kill took jobspecs like kill %1 like every job control shell since BSD invented it?

job is handicapped compared to bash's "jobs" which can list only running or stopped jobs with options.

It seems to me that every shell that ever had job control, starting from csh, has always had the kill, wait, bg, fg, jobs, set of controls for a good reason, and nushell has gratuitously given up that for a confusing situation of kill vs job kill.

Lack of ability to background with something close to the simplicity of "&" is a real deal killer. And without "wait" there's a whole raft of things that are impossible. It's not like wait is hard to implement or something.

Describe the solution you'd like

  • job kill take multiple arguments
  • job background command
  • job wait command
  • ideally more UNIXy way of doing it, aka "&", fg, bg, jobs, wait, kill taking job specs

Describe alternatives you've considered

I don't know of any way to wait if it's not builtin.

Additional context and details

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    A:job-controlThe system to manage background jobs and concurrent taskscategory:enhancementNew feature or requeststatus:needs-triageAn issue that hasn't had any proper look

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions