ComputerCraft icon indicating copy to clipboard operation
ComputerCraft copied to clipboard

Show Filenames in Multishell Title

Open JakobDev opened this issue 8 years ago • 5 comments

With this PR, you can directly see, which File is opened is which tab, if you have multiple files open.

JakobDev avatar Nov 22 '17 15:11 JakobDev

I wonder if it'd be worth limiting file names to 20 characters or something? Maybe something like:

local name = fs.getName( path )
if #name > 20 then name = name:sub(1, 17) .. "..." end
if multishell and settings.get( "paint.multishell_title" ) == true then
  multishell.setTitle( multishell.getCurrent(), "paint (" .. name .. ")" )
end

This way really long file names won't fill the tab bar, but most file names will still display fine.

SquidDev avatar Dec 01 '17 20:12 SquidDev

Max length as a settings option?

Lupus590 avatar Dec 01 '17 20:12 Lupus590

@lupus590 Whiyh is a good name for this settings? Maybe multishell.max_filename? What do you think?

JakobDev avatar Dec 04 '17 16:12 JakobDev

I would suggest multishell.tabTitleMaxLength (or is underscore the established convention?)

Lupus590 avatar Dec 04 '17 19:12 Lupus590

Can one of the admins verify this patch?

thatcraniumguy avatar May 23 '18 00:05 thatcraniumguy