Do not silently change invalid names given to commands.#5175
Do not silently change invalid names given to commands.#5175barrettruth wants to merge 1 commit into
Conversation
ef3b46a to
0474444
Compare
|
Thanks. I think buffer names may as well not be allowed to contain |
0474444 to
ed06b88
Compare
|
Thanks, just fixed. |
|
OK the idea is good but I think we need to change So I think it would be better to change |
ed06b88 to
779a4b2
Compare
|
fixed. lmk if you want the empty + utf8_isvalid rejection moved out of |
|
Hmm. Maybe we are going too far with this. The reason for forbidding
The idea of removing it is that something in a pane could use an escape sequence to rename a window or change a pane title to contain But that only applies to escape sequences. There is no security boundary with commands - anything that could run So perhaps we should allow That is easy enough for session and paste buffer names but all window names go into Or maybe the whole thing is silly and aside from escape sequences we just allow commands to set anything and clean away only invalid UTF-8? If someone creates a session called What do you think? |
779a4b2 to
a2c907d
Compare
|
Agreed. I reverted it to only reject |
|
This isn't enough because They should be allowed from And the |
a2c907d to
a930ddf
Compare
|
sorry for the back and forth. fixed it at the root (window_set_name and screen_set_title now take a forbid set). # is only stripped from escape sequences and kept from rename-window/select-pane/automatic-rename. this is what you were looking for, correct? |
|
A couple of them look off. I asked ChatGPT to summarise them against what the rules should be. I took a quick look and it seems not to be lying:
Here are the rules:
|
closes #5173
use nicholas's solution: reject invalid session, window names instead of rewrite: add
check_nameand use it everywhere a command takes a name (session, window, pane title, buffer).there's no way to reject escape sequences and automatic renames so those still modify silently,
2 open questions here:
forbid=""(from 746dd91), so{#,:,.}are still allowed in them and only control chars get rejected. in other words, buffers end up reject-consistent but not character-level consistent with sessions/windows. lmk if you want to rather forbid#in buffers too