Fluentterminal: [Suggestion] Keyboard shortcut to zoom

Created on 14 Apr 2020  路  5Comments  路  Source: felixse/FluentTerminal

It would be great to have an option to change the font size with a keyboard shortcut (like CTRL + or CTRL -)

enhancement

Most helpful comment

Good idea, it would be also nice to zoom with CTRL + mouse wheel just like in mintty/wsltty.

All 5 comments

@felixse I'd be happy to try to implement it, if it's not too difficult (I'm not too familiar with UWP and TS and I don't understand the magic that binds them together). If you could give me some hints what files I should modify, I will let you know if I can do it.

As I understand, what is needed is just a keyboard shortcut to increase/decrease the font size.

I don't think this one is exactly beginner friendly, but you can have a try 馃槃

My thoughts on this:

  • add a new field to TerminalViewModel to track the current font size (initialize with the value form TerminalOptions)
  • add 2 new Commands for increase and decrease and add some new defaults to DefaultValueProvider
  • Extend TerminalViewModel.Terminal_KeyboardCommandReceived to handle the new commands (also validate that it does not go out of range)
  • The nasty part: add a new method in index.ts that takes a new fontSize and pass it to term.setOption
  • Extend XtermTerminalView with a call to this method
  • Bonus: Use TerminalViewModel.Overlay to show the new font size

@felixse Thanks for the recipe! :) I'll give it a try in the weekend I think.

Good idea, it would be also nice to zoom with CTRL + mouse wheel just like in mintty/wsltty.

@felixse I added a draft PR https://github.com/felixse/FluentTerminal/pull/728
Unfortunately I wasn't able to finish this, I do not know how to extend XtermTerminalView. Project is quite big and I do not really understand the architecture :/
BTW, it would be awesome if you shared some more information about this project (architecture, technnologies, etc.).

@zsbolyoczki Yeah, that would be useful.

Making the project run was a big problem. I actually had to switch to another laptop. FIrst one just wasn't able to build the project for some reason. On the other laptop I went further, but still restore was not possible without nuget.exe restore (Visual Studio alone wasn't able to restore). Took me some hours to figure this out :O

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sixtar picture sixtar  路  7Comments

ZhangWebber picture ZhangWebber  路  4Comments

clairernovotny picture clairernovotny  路  6Comments

IamIpanda picture IamIpanda  路  6Comments

Mystic8b picture Mystic8b  路  4Comments