Coder Social home page Coder Social logo

Job control about mrsh HOT 9 CLOSED

emersion avatar emersion commented on August 22, 2024
Job control

from mrsh.

Comments (9)

ddevault avatar ddevault commented on August 22, 2024

-m: This option shall be supported if the implementation supports the User Portability Utilities option. All jobs shall be run in their own process groups. Immediately before the shell issues a prompt after completion of the background job, a message reporting the exit status of the background job shall be written to standard error. If a foreground job stops, the shell shall write a message to standard error to that effect, formatted as described by the jobs utility. In addition, if a job changes status other than exiting (for example, if it stops for input or output or is stopped by a SIGSTOP signal), the shell shall write a similar message immediately prior to writing the next prompt. This option is enabled by default for interactive shells.

Related:

http://pubs.opengroup.org/onlinepubs/9699919799/utilities/bg.html

http://pubs.opengroup.org/onlinepubs/9699919799/utilities/fg.html

http://pubs.opengroup.org/onlinepubs/9699919799/utilities/kill.html

http://pubs.opengroup.org/onlinepubs/9699919799/utilities/wait.html

http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_204

from mrsh.

emersion avatar emersion commented on August 22, 2024

Some docs: https://www.gnu.org/software/libc/manual/html_node/Job-Control.html#Job-Control

from mrsh.

emersion avatar emersion commented on August 22, 2024

First step would be to make the glibc manual code work: https://git.sr.ht/~emersion/minishell

from mrsh.

emersion avatar emersion commented on August 22, 2024

Job control has been mostly sorted out now. Two builtins have been implemented: fg and bg. Other builtins will be easy to implement.

from mrsh.

emersion avatar emersion commented on August 22, 2024
  • Check disabling job control does the right thing
  • Store the AST that started each job (required for pretty-printing it)
  • Add support for fg and bg optional argument
  • Add kill, wait
  • Print terminated/stopped jobs info before printing PS1

from mrsh.

emersion avatar emersion commented on August 22, 2024

To store the AST, I think I'll make mrsh_job able to contain zero jobs so that we can create the job when executing the pipeline or async list.

from mrsh.

emersion avatar emersion commented on August 22, 2024

Jobs now store the AST node they have been created for.

from mrsh.

ddevault avatar ddevault commented on August 22, 2024

Nice ^^

from mrsh.

emersion avatar emersion commented on August 22, 2024

Job control has been almost completely sorted out by now, the complicated part is implemented. I've opened separate issues for the remaining bits.

from mrsh.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.