Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Suggestion] Keyboard shortcut to zoom #720

Open
marcinjahn opened this issue Apr 14, 2020 · 5 comments
Open

[Suggestion] Keyboard shortcut to zoom #720

marcinjahn opened this issue Apr 14, 2020 · 5 comments
Labels
enhancement New feature or request

Comments

@marcinjahn
Copy link
Contributor

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

@felixse felixse added the enhancement New feature or request label Apr 14, 2020
@marcinjahn
Copy link
Contributor Author

marcinjahn commented Apr 14, 2020

@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.

@felixse
Copy link
Owner

felixse commented Apr 14, 2020

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

@marcinjahn
Copy link
Contributor Author

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

@zsbolyoczki
Copy link

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

@marcinjahn
Copy link
Contributor Author

@felixse I added a draft PR #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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants