termux-app icon indicating copy to clipboard operation
termux-app copied to clipboard

Android N multi-window support

Open pp3345 opened this issue 9 years ago • 29 comments

This PR adds full multi-window support for Android 7.0+.

As soon as the framework enters multi-window mode a new button "New window" (keyboard shortcut Ctrl+Alt+W) becomes visible in the drawer menu. Clicking the button will create a new window. Terminal sessions are shared between windows, however, only one terminal window may attach to a specific session at a time. When creating a new window, the first unattached session will be attached to the new window. If no unattached sessions are available, a new session will be created.

Some screenshots of Termux running in multi-window mode on Android 7.1.1: screenshot_1478367704 (split-screen)

screenshot_1478368051 (freeform mode)

In the second screenshot, for example, the left window may not be attached to sessions 2 and 3, since they are already attached to the other windows. Any window can switch to session 4.

pp3345 avatar Nov 05 '16 18:11 pp3345

ping @fornwall Could you have a look at this PR? Thanks!

pp3345 avatar Nov 16 '16 20:11 pp3345

@pp3345 Thanks, looks interesting!

What's currently the best way to test freeform mode on a device or emulator?

fornwall avatar Nov 16 '16 22:11 fornwall

Freeform mode is still unofficial and experimental in Android. It may be enabled on any device or emulator running Android 7.0 or 7.1 by executing adb shell settings put global enable_freeform_support 1. After rebooting the device (or emulator), apps may be switched to freeform mode by opening Recent Apps and long-clicking on an app window until a square icon appears in the upper right (rarely it won't appear, then just close Recent Apps and try again). Clicking the icon will move the app to freeform. Freeform still has some quirks and bugs, but most of the time it works okay. Split-screen always works and does not require unlocking freeform mode.

Freeform feels better when using a real mouse instead of touch input, especially when resizing windows (you need to hit some unhighlighted area around the window for resizing with touch input), but for testing, touch should be okay.

pp3345 avatar Nov 16 '16 23:11 pp3345

ping @fornwall Any news?

pp3345 avatar Dec 04 '16 22:12 pp3345

@pp3345 Sorry for the delay here! Will look into it soon and get back to you (I just have some other issues and features in the pipeline I want to get done first).

fornwall avatar Dec 26 '16 04:12 fornwall

News?

pylerSM avatar Mar 27 '17 00:03 pylerSM

?

TheDiamondYT1 avatar Jun 12 '17 19:06 TheDiamondYT1

Nothing has happened here for a while since I didn't receive any feedback from the Termux developer. By now, the PR has some conflicts with the base branch. I'll be happy to resolve those conflicts and update the PR but first I'd like to get some feedback from @fornwall or else this doesn't seem to make a lot of sense to me.

pp3345 avatar Jun 26 '17 08:06 pp3345

Any updates here?

luisdavim avatar Jul 17 '17 17:07 luisdavim

what's holding this up? I would really like to see this feature added.

luisdavim avatar Jul 28 '17 17:07 luisdavim

I've put the app functionality itself on the back burner for a while focusing on packages, but I'm planning to give the app itself some love going forward!

@pp3345 About freeform mode, has anything happened with that in the upcoming Android 8? Is it getting more official and/or has anything changed?

fornwall avatar Jul 29 '17 02:07 fornwall

@fornwall I am not sure about that, I haven't tried out Android O so far. There is nothing about changes to multi-window support in https://developer.android.com/preview/api-overview.html. I'll install the current DP on my Pixel C and see if anything has changed.

pp3345 avatar Aug 01 '17 19:08 pp3345

Freeform seems to be just the same as in Android 7. The same bugs are still there and it still needs to be enabled manually via adb. This PR still seems to work fine though after some quick tests:

screenshot_20170802-225542

pp3345 avatar Aug 02 '17 20:08 pp3345

I think this should be merged.

luisdavim avatar Aug 15 '17 07:08 luisdavim

@fornwall So, is this going to happen any time soon?

T-vK avatar Aug 23 '17 13:08 T-vK

Ping. This would help me a lot. Please merge.

bvgastel avatar Aug 28 '17 22:08 bvgastel

This would be great, starting to use my Samsung Dex a lot for development. Sometimes I like to create multiple windows to watch multiple build processes. Any chance of getting these conflicts resolved and this PR merged in for a release please?

davemackintosh avatar Oct 30 '18 10:10 davemackintosh

Isn't this pr obsoleted by https://github.com/termux/termux-app/pull/339? At least the split screen feature works for me on a Lenovo tablet. Or are you talking about the free form windows?

fbartels avatar Oct 30 '18 10:10 fbartels

Oh oops. Yes, sorry. I filtered on open PRs when I should have filtered on both open and closed. Nice! Now I'm going to look into better mouse support for selecting text and clicking links. Thanks

davemackintosh avatar Oct 30 '18 10:10 davemackintosh

Ping @pp3345, still need this and want to get it in?

finagolfin avatar Aug 05 '20 04:08 finagolfin

@buttaface Never received any feedback from @fornwall and time has passed, so there is a pile of conflicts now. I am not really motivated to put effort into fixing them given that this PR got ignored for so much time already.

pp3345 avatar Aug 05 '20 20:08 pp3345

@fornwall or @xeffyr, if you'd like to get this feature in, I will work with @pp345 to get it merged. Just let us know.

finagolfin avatar Aug 06 '20 02:08 finagolfin

@buttaface I'm ok with it, if it doesn't conflict with or break existing functionality.

ghost avatar Aug 06 '20 09:08 ghost

@pp3345, it looks like this pull has slipped through the cracks. @xeffyr and I are both more recent committers for Termux and if you update your pull, I will review it and help you get this in.

finagolfin avatar Aug 06 '20 10:08 finagolfin

@buttaface: Okay, I'll try to update the PR. I am afraid I won't have time for that soon though, please give me a month or two.

pp3345 avatar Aug 12 '20 12:08 pp3345

No hurry, take your time.

finagolfin avatar Aug 12 '20 14:08 finagolfin

Hey any updates? This feature would be an great addition

nift4 avatar Dec 04 '21 12:12 nift4

Any chances of this still making it to a release in the future?

luisdavim avatar May 19 '22 22:05 luisdavim

Any chances of this still making it to a release in the future?

There is always a chance (in multiverse of madness)! ;)

The idea is actually pretty interesting. However, termux-app has been refactored greatly in the last year or so, so branch would need updating. I would need to take a closer look at the code too. Also will need to take into consideration that termux-float needs to be merged into termux-app in future, which may have similar reqs.

agnostic-apollo avatar May 20 '22 07:05 agnostic-apollo