Skip to content

Commit

Permalink
Merge pull request #1964 from h-east/update-terminal
Browse files Browse the repository at this point in the history
Update terminal.{txt,jax}
  • Loading branch information
h-east authored Mar 3, 2025
2 parents 012151f + a9069b9 commit b8c6847
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
13 changes: 7 additions & 6 deletions doc/terminal.jax
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*terminal.txt* For Vim バージョン 9.1. Last change: 2025 Feb 13
*terminal.txt* For Vim バージョン 9.1. Last change: 2025 Feb 22


VIMリファレンスマニュアル by Bram Moolenaar
Expand Down Expand Up @@ -1075,11 +1075,12 @@ Vim からジョブへ: term_sendkeys() ~
JSONでの例: >
["drop", "path/file.txt", {"ff": "dos"}]
Vimにこのエスケープシーケンスを送信させるトリック: >
exe "set t_ts=\<Esc>]51; t_fs=\x07"
let &titlestring = '["call","Tapi_TryThis",["hello",123]]'
redraw
set t_ts& t_fs&
|echoraw()| を使用すると、Vim にこのエスケープシーケンスを送信させることができ
る: >
call echoraw("\<ESC>]51;[\"call\", \"Tapi_TryThis\", [\"hello\", 123]]\x07")
call echoraw("\<Esc>]51;[\"drop\", \"README.md\"]\x07")
Note: JSON では文字列値をダブルクォートで囲む必要があるため、エスケープする必
要がある。

理論的根拠: コマンドや式を許可しないのはなぜか? セキュリティ上の問題が生じる
可能性があるため。
Expand Down
12 changes: 6 additions & 6 deletions en/terminal.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*terminal.txt* For Vim version 9.1. Last change: 2025 Feb 13
*terminal.txt* For Vim version 9.1. Last change: 2025 Feb 22


VIM REFERENCE MANUAL by Bram Moolenaar
Expand Down Expand Up @@ -1092,11 +1092,11 @@ Currently supported commands:
Example in JSON: >
["drop", "path/file.txt", {"ff": "dos"}]
A trick to have Vim send this escape sequence: >
exe "set t_ts=\<Esc>]51; t_fs=\x07"
let &titlestring = '["call","Tapi_TryThis",["hello",123]]'
redraw
set t_ts& t_fs&
You can use |echoraw()| to make Vim send this escape sequence: >
call echoraw("\<ESC>]51;[\"call\", \"Tapi_TryThis\", [\"hello\", 123]]\x07")
call echoraw("\<Esc>]51;[\"drop\", \"README.md\"]\x07")
Note: JSON requires double quotes around string values, hence those have to be
escaped.

Rationale: Why not allow for any command or expression? Because that might
create a security problem.
Expand Down

0 comments on commit b8c6847

Please sign in to comment.