mirror of
https://github.com/neovim/neovim.git
synced 2025-10-26 12:27:24 +00:00
feat(jobs): jobstart(…,{term=true}), deprecate termopen() #31343
Problem: `termopen` has long been a superficial wrapper around `jobstart`, and has no real purpose. Also, `vim.system` and `nvim_open_term` presumably will replace all features of `jobstart` and `termopen`, so centralizing the logic will help with that. Solution: - Introduce `eval/deprecated.c`, where all deprecated eval funcs will live. - Introduce "term" flag of `jobstart`. - Deprecate `termopen`.
This commit is contained in:
28
runtime/lua/vim/_meta/vimfn.lua
generated
28
runtime/lua/vim/_meta/vimfn.lua
generated
@@ -4805,7 +4805,7 @@ function vim.fn.jobresize(job, width, height) end
|
||||
--- @return any
|
||||
function vim.fn.jobsend(...) end
|
||||
|
||||
--- Note: Prefer |vim.system()| in Lua (unless using the `pty` option).
|
||||
--- Note: Prefer |vim.system()| in Lua (unless using `rpc`, `pty`, or `term`).
|
||||
---
|
||||
--- Spawns {cmd} as a job.
|
||||
--- If {cmd} is a List it runs directly (no 'shell').
|
||||
@@ -4813,8 +4813,11 @@ function vim.fn.jobsend(...) end
|
||||
--- call jobstart(split(&shell) + split(&shellcmdflag) + ['{cmd}'])
|
||||
--- <(See |shell-unquoting| for details.)
|
||||
---
|
||||
--- Example: >vim
|
||||
--- call jobstart('nvim -h', {'on_stdout':{j,d,e->append(line('.'),d)}})
|
||||
--- Example: start a job and handle its output: >vim
|
||||
--- call jobstart(['nvim', '-h'], {'on_stdout':{j,d,e->append(line('.'),d)}})
|
||||
--- <
|
||||
--- Example: start a job in a |terminal| connected to the current buffer: >vim
|
||||
--- call jobstart(['nvim', '-h'], {'term':v:true})
|
||||
--- <
|
||||
--- Returns |job-id| on success, 0 on invalid arguments (or job
|
||||
--- table is full), -1 if {cmd}[0] or 'shell' is not executable.
|
||||
@@ -4879,6 +4882,10 @@ function vim.fn.jobsend(...) end
|
||||
--- stdin: (string) Either "pipe" (default) to connect the
|
||||
--- job's stdin to a channel or "null" to disconnect
|
||||
--- stdin.
|
||||
--- term: (boolean) Spawns {cmd} in a new pseudo-terminal session
|
||||
--- connected to the current (unmodified) buffer. Implies "pty".
|
||||
--- Default "height" and "width" are set to the current window
|
||||
--- dimensions. |jobstart()|. Defaults $TERM to "xterm-256color".
|
||||
--- width: (number) Width of the `pty` terminal.
|
||||
---
|
||||
--- {opts} is passed as |self| dictionary to the callback; the
|
||||
@@ -10168,19 +10175,8 @@ function vim.fn.tanh(expr) end
|
||||
--- @return string
|
||||
function vim.fn.tempname() end
|
||||
|
||||
--- Spawns {cmd} in a new pseudo-terminal session connected
|
||||
--- to the current (unmodified) buffer. Parameters and behavior
|
||||
--- are the same as |jobstart()| except "pty", "width", "height",
|
||||
--- and "TERM" are ignored: "height" and "width" are taken from
|
||||
--- the current window. Note that termopen() implies a "pty" arg
|
||||
--- to jobstart(), and thus has the implications documented at
|
||||
--- |jobstart()|.
|
||||
---
|
||||
--- Returns the same values as jobstart().
|
||||
---
|
||||
--- Terminal environment is initialized as in |jobstart-env|,
|
||||
--- except $TERM is set to "xterm-256color". Full behavior is
|
||||
--- described in |terminal|.
|
||||
--- @deprecated
|
||||
--- Use |jobstart()| with `{term: v:true}` instead.
|
||||
---
|
||||
--- @param cmd string|string[]
|
||||
--- @param opts? table
|
||||
|
||||
Reference in New Issue
Block a user