termux / termux-app

Termux - a terminal emulator application for Android OS extendible by variety of packages.
https://f-droid.org/en/packages/com.termux
Other
35.52k stars 3.73k forks source link

[Feature]: Zoom on device without touchscreen (WSA) #2383

Open ghost opened 2 years ago

ghost commented 2 years ago

Feature description

Currently Termux only supports changing font size by two-finger pinch-zooming, which is not doable on devices without touchscreen like Android-x86 VM and WSA.

Additional information

Although I could also use ADB it was always to cumbersome to choose device by IP (I sometimes have up to 4 devices hooked on my PC).

ghost commented 2 years ago

https://wiki.termux.com/wiki/Hardware_Keyboard:

Ctrl+Alt:

  • +/- → Adjust text size
agnostic-apollo commented 2 years ago

@xeffyr that doesn't work with laptop/pc keyboard. Do plan on adding the option but some users want to change font from scripts as well. Only current font size is stored in shared preferences, so changing font size from scripts needs some thinking.

Splarkszter commented 1 year ago

My touch-screen is broken and eventually had to re-install termux... now it's hard to read when i share the screen to the PC... ctrl+alt doesn't work for some reason.

twaik commented 9 months ago

What about adding Ctrl+mouse scrolling behaviour for zoom? It works in most Windows and Linux programs that support content zooming so it is legit to implement it here.

twaik commented 7 months ago

That can be used as a workaround (in the case if Ctrl+Alt+'+' or Ctrl+Alt+'-' do not work or you do not have Ctrl or Alt).

  1. Launch termux on TV.
  2. Install sshd with pkg i openssh
  3. Set password with passwd.
  4. Start sshd with sshd command.
  5. Connect ssh from PC or another termux (on phone or tablet). Default port is 8022.
  6. Finish session with "Ctrl+D" or "exit" command. Do not press exit on notification, it will kill sshd. In the case if activity is launched during next step changes will not be kept.
  7. Edit /data/data/com.termux/shared_prefs/com.termux_preferences.xml (i.e. with nano). Add <string name="fontsize">18</string> somewhere in the middle or change existing fontsize property. Like this:
    <?xml version='1.0' encoding='utf-8' standalone='yes' ?>
    <map>
    <int name="app_shell_number_since_boot" value="0" />
    <string name="current_session">133166f0-7b1a-47c4-a3e4-4d222cc6640a</string>
    <int name="log_level" value="1" />
    <string name="fontsize">18</string>
    <int name="terminal_session_number_since_boot" value="6" />
    </map>
  8. Save changes (Ctrl+X, then 'y' in the case of nano).
  9. Launch Termux app.