set-title.lua (382B)
1 local function set_title(s) 2 vis:command("!printf '\\033]2;vis: " .. s .. "\\007'") 3 end 4 5 vis.events.subscribe(vis.events.WIN_OPEN, function(win) 6 set_title(win.file.name or "[No Name]") 7 end) 8 9 vis.events.subscribe(vis.events.FILE_SAVE_POST, function(file) 10 set_title(file.name) 11 end) 12 13 vis.events.subscribe(vis.events.QUIT, function() 14 vis:message("") 15 vis:command("!tput reset") 16 end)