summaryrefslogtreecommitdiffstats
path: root/src/terminal.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/terminal.c')
-rw-r--r--src/terminal.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/terminal.c b/src/terminal.c
index 07b69c6a7c..648fc78728 100644
--- a/src/terminal.c
+++ b/src/terminal.c
@@ -6171,8 +6171,16 @@ f_term_getjob(typval_T *argvars, typval_T *rettv)
buf = term_get_buf(argvars, "term_getjob()");
if (buf == NULL)
{
- rettv->v_type = VAR_SPECIAL;
- rettv->vval.v_number = VVAL_NULL;
+ if (in_vim9script())
+ {
+ rettv->v_type = VAR_JOB;
+ rettv->vval.v_job = NULL;
+ }
+ else
+ {
+ rettv->v_type = VAR_SPECIAL;
+ rettv->vval.v_number = VVAL_NULL;
+ }
return;
}