Skip to main content
Module

x/denops_std/function/vim/mod.ts>job_stop

📚 Standard module for denops.vim
Go to Latest
function job_stop
import { job_stop } from "https://deno.land/x/denops_std@v6.4.0/function/vim/mod.ts";

Stop the {job}. This can also be used to signal the job.

When {how} is omitted or is "term" the job will be terminated. For Unix SIGTERM is sent. On MS-Windows the job will be terminated forcedly (there is no "gentle" way). This goes to the process group, thus children may also be affected.

Effect for Unix: "term" SIGTERM (default) "hup" SIGHUP "quit" SIGQUIT "int" SIGINT "kill" SIGKILL (strongest way to stop) number signal with that number

Effect for MS-Windows: "term" terminate process forcedly (default) "hup" CTRL_BREAK "quit" CTRL_BREAK "int" CTRL_C "kill" terminate process forcedly Others CTRL_BREAK

On Unix the signal is sent to the process group. This means that when the job is "sh -c command" it affects both the shell and the command.

The result is a Number: 1 if the operation could be executed, 0 if "how" is not supported on the system. Note that even when the operation was executed, whether the job was actually stopped needs to be checked with job_status().

If the status of the job is "dead", the signal will not be sent. This is to avoid to stop the wrong job (esp. on Unix, where process numbers are recycled).

When using "kill" Vim will assume the job will die and close the channel.

Can also be used as a method:

GetJob()->job_stop()

Parameters

denops: Denops
job: unknown
optional
how: unknown

Returns

Promise<number>