mlterm
mlterm copied to clipboard
Apply configuration file changes on runtime
Thank you @arakiken for this great piece of software, it is a real treat.
I have been writing about it in the arch wiki and i'm still discovering its features.
One of the features it lacks however ( and i hope i'm not being rude, it is really hard to find a missing feature here ) is that it doesn't apply settings realtime when they are changed in main config file.
I suppose it should be an easy thing to implement since it already has the ability to apply changes from mlconfig, and yet i believe many users will appreciate the possibility to configure it by directly changing the config files.
Greetings from Tunisia !
Thanks. It might not be fully functional for you, but I wrote a tiny script to support the feature. https://github.com/arakiken/mlterm/blob/master/tool/accessories/applycfg.sh It simply reads ~/.mlterm/main and applies its changes. (Dynamically changeable options: https://github.com/arakiken/mlterm/blob/master/doc/en/PROTOCOL)
Thank you, the script works. It can only parse the main file, i suppose changing fonts doesn't work because of how they declared.
I add applyfontcfg.sh which parses ~/.mlterm/*font files. https://github.com/arakiken/mlterm/blob/master/tool/accessories/applyfontcfg.sh
That's nice, thanks!
I tried setting your script as an autocmd in vim that would be run each time i update the config files but the escape sequences get printed instead, i also tried running it inside a vim terminal but these escape sequences don't seem to work. i suppose it's because vim's terminal shell intercepts them.
PS. Is it possible to run these scripts by assigning them to a key in the key
file ? The man page addresses this issue by suggesting that escape sequences should be delivered directly by using proto:STRING
Adding a following line to ~/.vimrc makes vim apply configrations of ~/.mlterm/main automatically after updating it in my environment. autocmd BufWritePost ~/.mlterm/main !applycfg.sh
applycfg.sh uses OSC 5379. If you execute applycfg.sh in vim :terminal, mlterm can't receive it, beucase vim :terminal discards it.
It is possible to send escape sequences to mlterm by setting ~/.mlterm/key, but impossible to execute shell scripts.
I have tried that autocmd actually on neovim, that's why i said it wasn't working. It works only with vim. Sorry i wasn't precise enough, i didn't think it made any difference.
Neovim converts these escape codes and outputs this :
".mlterm/aafont" 1 line, 24 bytes written
:!applyfontcfg.sh
^[]5379;aafont:DEFAULT=SF Mono Light
shell returned 1
I have switched back to vim because of this one. Thanks for your assistance.