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

Zoom in/out Text in terminal #447

Closed
ferent opened this issue Mar 6, 2020 · 36 comments
Closed

Zoom in/out Text in terminal #447

ferent opened this issue Mar 6, 2020 · 36 comments
Labels
awaiting feedback We are waiting for issue creator's feedback to make progress. Please answer within 7 days. enhancement
Milestone

Comments

@ferent
Copy link

ferent commented Mar 6, 2020

Is your feature request related to a problem? Please describe.
Is not an actual problem, but I think is pretty common nowadays that we have to run some demos in a big TV, and I find pretty difficult to increase the size of the active terminal so everybody can see my screen ok.

Describe the solution you'd like
Like most of the terminals have, an keyboard shortcut to zoom in the text size (e.g. Ctrl+ +)

Describe alternatives you've considered
As an addition, a button in the bottom (where the yellow star and the locker are)

Extra-goal: Option to reset zoom as it is in the settings.

@gfrenoy
Copy link
Contributor

gfrenoy commented Mar 7, 2020

Interesting idea, thanks :)

I think it means using the vte-terminal-set-font-scale API from the VTE library.

@egmontkob, any advice?

@egmontkob
Copy link

Yup.

You can also implement ctrl+scroll smooth zooming, although it's not that smooth (cell size is always integer) and I personally don't like it (I have kinetic scrolling, and if I scroll first and then press ctrl for whatever other purpose then it might trigger).

You might also be interested in a discussion about zoom levels, and visual representation of the current zoom, at https://gitlab.gnome.org/GNOME/gnome-terminal/issues/140.

@hanspr hanspr mentioned this issue Mar 10, 2020
@hanspr
Copy link
Contributor

hanspr commented Mar 10, 2020

Tested, works well to me, guess that for temporary presentation porpoises is more than fine.

@hanspr
Copy link
Contributor

hanspr commented Mar 19, 2020

@ferent

The feature has been added to loki branch, if you are using the nightly build perhaps is already there. If so, and you can test, could you confirm it works?

<Ctrl++> Zoom in
<Ctrl+-> Zoom out
<Ctrl+0> Reset Zoom to default font size

@gfrenoy gfrenoy added the awaiting feedback We are waiting for issue creator's feedback to make progress. Please answer within 7 days. label Mar 21, 2020
@ferent
Copy link
Author

ferent commented Mar 22, 2020

Sorry I was totally off due all the recent devastating news. I will test the new feature tomorrow for sure.

Thanks for adding it so quickly!!

@no-response no-response bot removed the awaiting feedback We are waiting for issue creator's feedback to make progress. Please answer within 7 days. label Mar 22, 2020
@gfrenoy gfrenoy added the awaiting feedback We are waiting for issue creator's feedback to make progress. Please answer within 7 days. label Mar 23, 2020
@ferent
Copy link
Author

ferent commented Mar 25, 2020

Tested and after using loki branch Asbru doesn't open anymore. Get following error:

asbru-cm --verbose

INFO: Ásbrú Connection Manager 6.2.0 (asbru-cm) started with PID 12142
INFO: Desktop environment detected : gnome-shell
INFO: Config directory is '/home/pluk.eeghlan.net/alfredo.torres/.config/pac'
INFO: Used config file '/home/pluk.eeghlan.net/alfredo.torres/.config/pac/pac.nfreeze'
INFO: Virtual terminal emulator (VTE) version is 0.52
INFO: Theme directory is '/opt/asbru/res/themes/default'
HASH(0x561579b64620) is not of type Gtk3::Window at /usr/lib/x86_64-linux-gnu/perl5/5.26/Glib/Object/Introspection.pm line 67.

Tested and failing with all the following versions:
asbru-cm/bionic,bionic 6.2.0-1584996012-1
asbru-cm/bionic,bionic 6.2.0-1584995432-1
asbru-cm/bionic,bionic 6.2.0-1584895497-1
asbru-cm/bionic,bionic 6.2.0-1584889082-1
asbru-cm/bionic,bionic 6.2.0-1584805970-1

This is what I have in that pm file on that lines:

if ($flatten_array_ref_return) {
    return sub {
      shift if $shift_package_name;
      my $ref = __PACKAGE__->invoke($basename, $namespace, $name, @_);
      return if not defined $ref;
      return wantarray ? @$ref : $ref->[$#$ref];
    };
  } elsif ($handle_sentinel_boolean) {
    return sub {
      shift if $shift_package_name;
      my ($bool, @stuff) = __PACKAGE__->invoke($basename, $namespace, $name, @_);
      return $bool
        ? @stuff[0..$#stuff] # slice to correctly behave in scalar context
        : ();
    };
  } else {
    return sub {
      shift if $shift_package_name;
      return __PACKAGE__->invoke($basename, $namespace, $name, @_);
    };
  }

@no-response no-response bot removed the awaiting feedback We are waiting for issue creator's feedback to make progress. Please answer within 7 days. label Mar 25, 2020
@hanspr
Copy link
Contributor

hanspr commented Mar 25, 2020

What distro version your using? ubuntu 19?, other?

@hanspr
Copy link
Contributor

hanspr commented Mar 25, 2020

@KlaasT

Looks like a build problem for that distro? The --verbose flag is not working. I get this on ubuntu 19.10

imagen

@KlaasT
Copy link
Contributor

KlaasT commented Mar 25, 2020

Last build for Eoan was 6.2.0~1584996023 2 days ago. The build was successful.

@hanspr
Copy link
Contributor

hanspr commented Mar 25, 2020

@KlaasT

I did not explain my self correctly, is not about my image version, I mean @ferent he is the one with the problem. My image is to say that it actually is fine and behaves differently than his installed version.

He is getting this, asbru-cm will not start and the --verbose flag is not working.

imagen

@ferent
Copy link
Author

ferent commented Mar 25, 2020

Could be that is me. I'm on ubuntu 18.04

I just followed the instructions here:
$ curl -s https://packagecloud.io/install/repositories/asbru-cm/loki/script.deb.sh | sudo bash
$ sudo apt-get install asbru-cm

Is there anything I'm missing?
Also, anything I can do to debug the issue?

@hanspr
Copy link
Contributor

hanspr commented Mar 25, 2020

@ferent

I just installed a VM with Ubuntu 18.04, followed the same instructions you did and it worked for me.

Something seams broken in your desktop, some missing package, old package, wrong package versions. I'm not good at this stuff of debugging package versions, dependencies. Maybe @KlaasT or @gfrenoy can give you better hints.

imagen

@hanspr
Copy link
Contributor

hanspr commented Mar 25, 2020

Or maybe it has to do with the tray icon, because your messages end just before the INFO: Using Gnome tray icon message.

Do you have any of those ubuntu tray hacks installed to show the asbru-cm tray icon?

@ferent
Copy link
Author

ferent commented Mar 25, 2020

My ubuntu desktop is pretty flat.
I think it could be related to one configuration setting I have in Asbru.

Is there an easy way to start an clean execution of asbru? with no risk of loosing my current setup, like moving the configuration to another place and then restoring it??

@hanspr
Copy link
Contributor

hanspr commented Mar 25, 2020

You could test like this: asbru-cm --config-dir=pac.test

This will create and open a new empty configuration in your .config directory.

If it starts, then that is a confirmation of a configuration settings. If it does not start, then is something else.

@hanspr
Copy link
Contributor

hanspr commented Mar 25, 2020

If you have confirm, or think your configuration settings are the problem.

Copy /home/pluk.eeghlan.net/alfredo.torres/.config/pac

to your home dir

And run this program below to anonymize the data so you can uploaded and I can tests in my environment. Rename to : anonymize.pl

perl anonymize.pl pac.yml

This should create a debug.txt file

Check with a text editor your personal data has been removed and upload so I can check it.

anonymize.txt

@KlaasT
Copy link
Contributor

KlaasT commented Mar 25, 2020

It could well be that with other Perl versions introspection is behaving differently. Some hash doesn't seem to have the correct type (GTK3:Window).

@ferent
Copy link
Author

ferent commented Mar 25, 2020

I can confirm with a new configuration file it opens and work with no issue. So there must be a setting that breaks it.

@hanspr here you have the debug file
debug.txt

@hanspr
Copy link
Contributor

hanspr commented Mar 25, 2020

Hi @ferent

Could not reproduce, it loads correctly in Ubuntu 18 with your anonimized data.

imagen

Maybe is something related to utf8 characters (áóñ»ð€) in your pac.yml file. Or some wrong encoded character inside the file.

Open the original pac.yml, look for non ascii (english) characters (utf8) and tell me what are those and where are they so I can introduce them manually in the file and see if is that.

@ferent
Copy link
Author

ferent commented Mar 27, 2020

After a few test, I think the issue I have has to do with the password screen I have setup in Asbru
Preferences > Protect with password > Set

Using a temporary settings file, if I click on that option and click the button to set the password I get the same GTK error I was getting with my real config.
Then if I close the app, it doesn't open any more throwing the GTK error I mentioned at the begining of the thread.

Also I checked if I had non ASCII chars, and I can confirm I don't have any.

@ferent
Copy link
Author

ferent commented Mar 27, 2020

More testing:
Comparing pac.test (broken config) and pac.test2 (working config)
even copying the pac.yml from the working to non working dir, app doesn't start.
Only way is to copy pac.nfreezr from working to non working and then it starts with no issue.

Both pac.nfreezr files (working and not working) are massively different even when I have only changed the password option.

@ferent
Copy link
Author

ferent commented Mar 27, 2020

Confirmed, after disable the password setting in my original configuration, updating asbru, it starts ok now. Woop Woop

But the zoom in shortcut ctrl++ doesn't work, it types "====" symbols in the terminal.
I tried with multiple shortcuts, alt+, fn+, win+, sift+ and nothing works.

@hanspr
Copy link
Contributor

hanspr commented Mar 27, 2020

Sent the PR #520 to fix the password crash issue

But the Ctrl + works in my test environment.

I have installed this version make sure is this one or newer.

imagen

Peek 27-03-2020 09-31

gfrenoy pushed a commit that referenced this issue Mar 27, 2020
- Validate window type used in wEnterValue and wMessage
- Fix correct window object sent in PACMain and PACConfig
@gfrenoy
Copy link
Contributor

gfrenoy commented Mar 28, 2020

Ctrl+ / Ctrl- works for me as well ... (I'm using Ubuntu 18.04)

(The focus needs to be on the terminal though)

@gfrenoy gfrenoy added the awaiting feedback We are waiting for issue creator's feedback to make progress. Please answer within 7 days. label Mar 28, 2020
@ferent
Copy link
Author

ferent commented Apr 4, 2020

Very interestingly, I've discover I can zoom out but not zoom in. I think it is because I'm using an UK keyboard and the + only works when I press shift. So for e.g . in my standard linux terminal, I have to do "CTRL + shift + +" to zoom in.

Also a ctrl + 0 would be great to reset the terminal as it how it was originally :)

@no-response no-response bot removed the awaiting feedback We are waiting for issue creator's feedback to make progress. Please answer within 7 days. label Apr 4, 2020
@hanspr
Copy link
Contributor

hanspr commented Apr 4, 2020

If you have a numeric key pad, try with those ones, + - 0

And if this image is correct, then you do have to use the shift, to get the plus on your keyboard.

imagen

Regarding the - and 0, they should work normally.

Also a ctrl + 0 would be great to reset the terminal as it how it was originally :)

Read again

#447 (comment)

@gfrenoy
Copy link
Contributor

gfrenoy commented Apr 4, 2020

On a Belgian/French layout, you also have to use shift to access + ; and ... zoom does not work with this combination :-/ You have to use the + on the numeric pad.

Interestingly enough, I never really realized I was using the numeric pad only ! It's the same shortcut as in the browser but there, using the "normal" + works fine.

In the code, this is caused by the split of the handlers between key combinations with + and only.

I made a change to hopefully manage this better.

Let us know if it works for you.

@gfrenoy gfrenoy added the awaiting feedback We are waiting for issue creator's feedback to make progress. Please answer within 7 days. label Apr 4, 2020
@popxunga
Copy link

popxunga commented Apr 4, 2020

Hi @gfrenoy
Tested this on EL7 loki build.
Zoom-in and Zoom-out works fine.
But when I press the reset key combination Ctrl+0, the font size remains unchanged.
In fact what the key combination Key+# is doing, is change the focus to the terminal in the position #.
So, when I press Ctrl+0 the focus goes to the Info tab.
When I press Ctrl+1 the focus goes to the 1st open terminal.
When I press Ctrl+2 the focus goes to the 2nd open terminal.
And so on.
Thanks.

@ferent
Copy link
Author

ferent commented Apr 4, 2020

Ctrl + works now like a charm, and Ctrl - too.
Great job guys!!
Ctrl + 0 goes to the info tab as described in the previous message, but having the zoom in and out is more than enough for me. You can close the ticket if you want and thanks again for such a great job.

@no-response no-response bot removed the awaiting feedback We are waiting for issue creator's feedback to make progress. Please answer within 7 days. label Apr 4, 2020
@gfrenoy
Copy link
Contributor

gfrenoy commented Apr 4, 2020

Waw ; some many years using Ásbrú / PAC and I never realized Ctrl+N (N = a number) would set the focus on a particular tab :)

Actually with my Belgian/French layout ; it does not work. It's the same "design" error about the shift state ... I'll see if I can do something about that.

But anyway : as Ctrl+0 is already used ; we'll need to find another shortcut to reset the zoom factor.

Any suggestion ?

@ferent
Copy link
Author

ferent commented Apr 4, 2020

I honestly don't see any advantage on using ctrl+0 to go to the info screen, changing terminals with shortcuts is great but don't find myself having to go to the info screen constantly (so needing a shortcut for it)
My suggestion is to remove the shortcut and change it to do the size reset as many other terminals do.

@popxunga
Copy link

popxunga commented Apr 4, 2020

Hi ...
My suggestion is not use a shortcut to reset the font size.
In the terminal context menu, there's an "Terminal" submenu already, with 2 options "Reset" and "Reset & Clear". What do you think about having a 3rd option there to reset the terminal font size ?
Thanks.

gfrenoy added a commit that referenced this issue Apr 5, 2020
- Ctrl+N (where N is a number) can now be used for tab selection even if using "shift"
- Ctrl+0 replaced by Ctrl+. (period) to reset zoom factor
- Reformat
- Remove commented out code (make it available through the --verbose option)
@gfrenoy
Copy link
Contributor

gfrenoy commented Apr 5, 2020

Thanks for your feedback. The final solution will be to be able to configure our own shortcuts but in the meantime, let's try the following:

  • Ctrl+0 will be kept for tab selection (to avoid breaking anything that already exists)
  • Ctrl+. (period) will be used to reset the zoom factor

@popxunga
Copy link

popxunga commented Apr 5, 2020

Hi @gfrenoy ...
Ctrl+. working fine on Loki EL7 build.
Thanks.

@gfrenoy gfrenoy added the awaiting feedback We are waiting for issue creator's feedback to make progress. Please answer within 7 days. label Apr 7, 2020
@gfrenoy gfrenoy closed this as completed Apr 15, 2020
@gfrenoy gfrenoy added this to the 6.2.0 milestone May 10, 2020
@adielw8
Copy link

adielw8 commented Mar 11, 2022

ctrl + shift + +

@tommyHumble
Copy link

hello guys!
I'm new here, so don't be mad for stupid questions)

But I have this exact problem with ASBRU 'Zoom in Text' and 'Zoom out Text' functions (the only one that not working). I change hotkeys for those on different combination, but that was useless. I'm using i3 and I think it can be the main reason of the problem

OS - Endeavour (Arch)
Asbru - v6.4.0

May be any suggestions or prescriptions?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting feedback We are waiting for issue creator's feedback to make progress. Please answer within 7 days. enhancement
Projects
None yet
Development

No branches or pull requests

8 participants