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
34.69k stars 3.65k forks source link

Gesture navigation makes opening session drawer nearly impossible #1325

Open dattas opened 4 years ago

dattas commented 4 years ago

Problem description Using a Pixel device, if you enable gesture navigation (which is the default on the new pixel 4) you can no longer swipe in from the left to get the session drawer. I haven't been able to isolate it but typically you only get the back gesture with some weird gestures sometimes getting the session drawer. When disabling gesture navigation it is very easy to open it.

Steps to reproduce On Android 10, enable system gesture navigation then open Termux and try to swipe from the left to open the session drawer, you get the back gesture instead.

Expected behavior Session drawer should be opened or there should be an option to open it via the long click menu

Additional information

All packages up to date
Subscribed repositories:
https://dl.bintray.com/grimler/science-packages-24 science/stable
https://dl.bintray.com/grimler/game-packages-24 games/stable
https://termux.org/packages stable/main
System information:
Linux localhost 4.14.111-gb7713fd5d6ed-ab5820689 #1 SMP PREEMPT Wed Aug 21 22:50:41 UTC 2019 aarch64 Android
Termux-packages arch:
aarch64
Android version:
10
Device manufacturer:
Google
Device model:
Pixel 4 XL
norbertc commented 4 years ago

have you tried pressing the edge for at least 1-2 seconds? the session drawer side menu should peek and will allow you to pull it.

iGom commented 4 years ago

have you tried pressing the edge for at least 1-2 seconds? the session drawer side menu should peek and will allow you to pull it.

It doesn't work for me. (Galaxy Note 9, Android 10)

norbertc commented 4 years ago

try sliding it diagonally from edge. it works on my pixel 4 xl.

dattas commented 4 years ago

Diagonally is slightly more reliable than the 1-2 second holding or with system gesture navigation disabled. I think that informing the OS ( https://developer.android.com/guide/navigation/gesturenav#conflicting-gestures )that you expect gestures on the left hand side would be a better solution than knowing to slide it diagonally if you have gestures enabled. Then it should work as it does in previous versions of android or with gesture navigation off.

iGom commented 4 years ago

Oh, I didn't know about that, diagonal sliding works, thank you.

dirtslayer commented 4 years ago

Similar issue but only in portrait orientation, if i turn the device to landscape the drawer works ... nevermind ... my protective case was blocking the very edge of my screen

hoxu commented 4 years ago

Could this be fixed? Even with the tips in this thread, the menu is damn near impossible to open. Having gesture navigation enabled basically limits using Termux with only one tab.

ghost commented 4 years ago

Swiping with two fingers similar to the three finger screenshot gesture worked for me.

SharkWipf commented 4 years ago

Termux is currently the only reason I need to use button nav over gesture nav on my Oneplus 8, diagonal sliding still triggers the back gesture on OxygenOS 10, and long-pressing the edge is near-impossible with the OP8's dumb curved screen.
Would love to see a change to make this usable again, especially as Android seems to move more towards full gesture-based navigation by default.

trygveaa commented 4 years ago

I have now added support for a key in the extra keys row to open the drawer in PR #1479. When using the PR, you can include it in extra-keys by specifying the key DRAWER.

hoxu commented 4 years ago

Nice! But I really hope swiping is made to work when gesture navigation is enabled.

trygveaa commented 4 years ago

But I really hope swiping is made to work when gesture navigation is enabled.

I don't think there is anything Termux can do about that. An app can't influence how the gesture navigation works as far as I know.

You can see the same issue in other apps too, e.g. Google Keep.

hoxu commented 4 years ago

I don't think there is anything Termux can do about that. An app can't influence how the gesture navigation works as far as I know.

Slide for Reddit opens a similar sidebar to Termux when gesture navigation is enabled and you swipe from left side, so it's definitely doable. Shouldn't be too much trouble checking out how Slide is doing it, and implementing a similar change to Termux.

trygveaa commented 4 years ago

I tried that app now, and it behaves fairly similar to Termux on my phone (Pixel 3). There's definitely still some conflict between the drawer and gesture. But I think one difference might be that it allows you to drag a bit further from the edge to open the drawer, so changing that may help.

SharkWipf commented 4 years ago

Most apps (and launchers) allow the menu slide to be started from anywhere on the screen, not just the side. Simply start sliding sideways anywhere and the menu pops open.
This works great in any apps I've seen using it, and I don't see why it wouldn't work in Termux.

It might conflict with "mouse" input though, I don't know how far Termux' "mouse" support goes (it supports simple clicks at least) and if sliding touch is supported at all, but if it exists I'm sure someone has worked it into their workflow.

trygveaa commented 4 years ago

Most apps (and launchers) allow the menu slide to be started from anywhere on the screen, not just the side. Simply start sliding sideways anywhere and the menu pops open. This works great in any apps I've seen using it, and I don't see why it wouldn't work in Termux.

That's not my experience. The mentioned Google Keep and Slide apps does not allow you to do that. The reason is that there's often other elements that you want to slide on.

It might conflict with "mouse" input though, I don't know how far Termux' "mouse" support goes (it supports simple clicks at least) and if sliding touch is supported at all, but if it exists I'm sure someone has worked it into their workflow.

Termux supports mouse drag when using a mouse, but not when using a touch screen as far as I know. There has been interest in enabling drag on touch screens though (#1384). So I guess it would conflict with mouse usage, and either way I don't think it would be a good idea to hinder this from being implemented for touch screens.

It also seems to conflict with scroll. I tested increasing the edge size now, and at least with the way I did it, you have to scroll perfectly vertically, otherwise the drawer opens instead of the screen being scrolled.

I think increasing the edge side a little bit, so that it is easier to use without hindering scroll or drag too much might be a good solution though.

hoxu commented 4 years ago

I tried that app now, and it behaves fairly similar to Termux on my phone (Pixel 3). There's definitely still some conflict between the drawer and gesture. But I think one difference might be that it allows you to drag a bit further from the edge to open the drawer, so changing that may help.

I don't have any issues on Slide for Reddit with gesture navigation enabled. It just always opens the drawer when swiping from left side. It's precisely what I would expect from Termux as well.

trygveaa commented 4 years ago

Well, this seems to be highly dependent on the phone. I can open the drawer just fine without triggering back as long as I swipe diagonally (except that it makes Termux scroll a bit too, which doesn't happen in Slide), but others are saying it's not working for them. If I swipe horizontally, I trigger back, both in Termux and Slide.

hoxu commented 4 years ago

What's the actual problem you are seeing with Slide for Reddit when swiping from left?

trygveaa commented 4 years ago

If I swipe horizontally, the back gesture triggers and the drawer doesn't open. If I try to swipe further from the edge, it changes tabs instead of opening the drawer.

If I swipe diagonally, it works fine, but this works for me in Termux too (except that it scrolls a bit, as mentioned).

If I hold the finger a short while on the edge, and then swipe horizontally, it also works fine and opens the drawer. This also works fine for me in Termux, though I do have to hold a bit closer to the edge in Termux than in Slide.

hoxu commented 4 years ago

If I swipe horizontally, the back gesture triggers and the drawer doesn't open.

So does this close Slide for Reddit?

Weird, because the drawer always opens for me, no matter how I swipe from left: horizontally or diagonally.

trygveaa commented 4 years ago

So does this close Slide for Reddit?

It opens a popup asking to confirm exit. If I change the back button behavior in settings to close application, it does close it.

I see that that option also can be set to open drawer. If I set it to that, the drawer always opens, but it seems like with that it's impossible to close the app.

It's not entirely consistent btw (with the back button set back to close application again). A few times it does open the drawer with a horizontal swipe, but more often it closes it.

hoxu commented 4 years ago

Ah, I didn't remember Slide for Reddit has a setting for this: "Back button behavior", mine is indeed set to "Open drawer".

I wouldn't personally mind if Termux worked similarly with gesture navigation: swiping from left would open the drawer, and it wouldn't be possible to close the app like that.

SharkWipf commented 4 years ago

Another option would be to simply allow another way of opening the drawer, i.e. double-tapping the edge, or adding it to the long-press menu or even to the Termux notification thingy.
For me personally, being able to drag it from a wider area, or even just disabling/changing the back gesture as suggested earlier (make back open the menu?) would be the ideal solution, but then again, I don't do or plan on doing anything that requires mouse input.

trygveaa commented 4 years ago

I wouldn't personally mind if Termux worked similarly with gesture navigation: swiping from left would open the drawer, and it wouldn't be possible to close the app like that.

I think it would have to be optional. Personally I'm not too fond of it in other apps, but when I think about it I rarely use back in Termux. Either way, yeah, adding an option like Slide has would be a potential solution.

It could also work so that the app is closed when back is triggered when the drawer is open. To close the drawer, you would swipe or press on the terminal area or entry in the list. E.g. Discord works like this. I think this is more practical than the way Slide works.

Another option would be to simply allow another way of opening the drawer, i.e. double-tapping the edge, or adding it to the long-press menu or even to the Termux notification thingy.

Another way to open it is what I did in #1479. With that you can open the drawer by pressing a key in the extra keys row.

hoxu commented 4 years ago

It could also work so that the app is closed when back is triggered when the drawer is open. To close the drawer, you would swipe or press on the terminal area or entry in the list. E.g. Discord works like this. I think this is more practical than the way Slide works.

I tested Discord, and it indeed works very nicely! Maybe Termux could even default to this behavior.

trygveaa commented 4 years ago

Apparently Discord allows you to swipe from anywhere like @SharkWipf mentioned. That might be problematic because of mouse drag, as I mentioned in a previous comment (I said there that it's not my experience that apps allows this, but maybe I just haven't noticed it in the ones that do). I also said it interacted badly with scroll, but I see that that works nicely in Discord.

SharkWipf commented 4 years ago

Telegram and Twitter also work this way, for the record, seems like many popular apps do it like this. Considering mouse support is a feature most users don't even know exists, making "wide dragging" opt-out for the few users that need mouse support sounds like a viable solution here.
The problem there is that Termux doesn't really have any sort of settings page right now, and adding one just for this would a bit of a pain I imagine.
Then again, it also opens up the possibility to add more settings for other features, so maybe not unthinkable?

trygveaa commented 4 years ago

Termux has settings, see the wiki.

I agree that having an option for swipe anywhere would be a good solution, provided someone makes it interact well with scrolling.

FossPrime commented 3 years ago

Diagonal swipe is the easiest. I either forgot the menu was there or didn't know it ever existed. This is an issue in all pixel phones, I've tested the... 3a, 4, 4a, 4a 5G, and 5.

It was a real surprise when I created a session by accident when trying to copy text, "deleting" what I was working on. Ctrl+Shift+C has become quite standard for copy and paste, Gnome terminal and Terminator use it, MS Terminal for windows and iTerm strongly support it.

We need the back button as it's frequently used to hide the on screen keyboard. As screen real state is important to us, we should have a gesture based way that works out of the box.

A menu button where ESC would be desireable for novices, kill the hyphen... It's only a nice to have, while the menu is a critical function when accidentally opening a new session with a keyboard and you don't know the shortcuts to switch between them.

Suggestions

ghost commented 3 years ago

A menu button where ESC would be desireable for novices

https://wiki.termux.com/wiki/Touch_Keyboard#Extra_Keys_Row

Extra keys row can be configured to add a button for opening drawer. See supported keys in https://wiki.termux.com/wiki/Touch_Keyboard#Supported_keys.

legen07 commented 2 years ago

have you tried pressing the edge for at least 1-2 seconds? the session drawer side menu should peek and will allow you to pull it.

This one work

Thank you sooooo much

Wow the way I've struggled with this thing for a very long and lastly decided to search on how to solve it !!