workspace: fix xterm cmdargs (asyncssh create_process single command)

This commit is contained in:
p 2026-08-13 17:00:42 +08:00
parent 67f318888d
commit 9f4307b5d9

View File

@ -1,4 +1,5 @@
import os
import shlex
file_id = (params_kw or {}).get('id', '').strip()
@ -29,7 +30,7 @@ if not file_id or not ws_dir:
r = DictObject()
r.host = 'localhost'
r.username = 'pipeline'
r.cmdargs = ['echo', '未指定文件']
r.cmdargs = ['echo 未指定文件']
return r
full_path = ws_dir + '/' + file_id
@ -41,11 +42,11 @@ if not real_full.startswith(real_ws + os.sep):
r = DictObject()
r.host = 'localhost'
r.username = 'pipeline'
r.cmdargs = ['echo', '非法路径']
r.cmdargs = ['echo 非法路径']
return r
r = DictObject()
r.host = 'localhost'
r.username = 'pipeline'
r.cmdargs = ['vi', full_path]
r.cmdargs = ['vi ' + shlex.quote(full_path)]
return r