Skip to content

feat: multi window support#4961

Open
ozwaldorf wants to merge 8 commits intotermux:masterfrom
ozwaldorf:feat/multi-window
Open

feat: multi window support#4961
ozwaldorf wants to merge 8 commits intotermux:masterfrom
ozwaldorf:feat/multi-window

Conversation

@ozwaldorf
Copy link

@ozwaldorf ozwaldorf commented Feb 11, 2026

Adds support for multi-window mode on android 7+. Replaces #187.

Replicates the changes from the previous pr with the following differences:

  • extends the existing TerminalSessionClient interface with support for multiple activities
  • session claiming is atomic to prevent race conditions
  • additional safety checks added to prevent session stealing
  • new window shortcut is always allowed in normal mode, and the os splits the current window with the new one automatically

Testing

Tested on:

  • (left) Samsung Galaxy Tab S7 FE 5G, running Android 14, in samsung (new) dex mode
  • (right) Oneplus 12, running Android 15.

@luisdavim
Copy link

Hope @agnostic-apollo or @fornwall can have a look soon, this would be great to have, specially with aluminium Os in the horizon.

if (!session.mAttached || session == currentSession) {
mActivity.getTermuxTerminalSessionClient().setCurrentSession(session);
mActivity.getDrawer().closeDrawers();
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I had always been wondering about this. Do you think it is possible to make touching one of the other sessions "bring that activity (window) to front" and switch to that session, or is it more straightforward to just make them "grayed out" so that you just need to manually switch?

Copy link
Author

@ozwaldorf ozwaldorf Feb 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm I'm not sure. This was mostly preserving the behavior from the other pr, however I was also thinking maybe this could be improved.

I think bringing the window into focus is a great idea!

In normal window mode, the CTRL+ALT+W shortcut can now open a new window
and enter multi-window mode automatically.
@ozwaldorf
Copy link
Author

ozwaldorf commented Feb 12, 2026

rebased onto latest master

@robertkirkman
Copy link
Member

robertkirkman commented Feb 12, 2026

I tested it on Android 7, it's working and everything seems normal.

Screenshot_20260211-213847

I built this in 2 GitHub Actions workflows here, I am sharing just in case one or the other helps someone test the PR more conveniently:

  1. com.termux build - useful for testing multi-window support on a device that doesn't already have official Termux installed
  2. two.termux build - useful for testing multi-window support on a device that does already have official Termux installed but which it would be a hassle to back up and delete, so the duplicated two.termux can be installed simultaneously without conflicting

@pp3345
Copy link

pp3345 commented Feb 12, 2026

Happy to see this being picked up again, looks great! Kudos @ozwaldorf

@robertkirkman
Copy link
Member

Builds of the current version:

@lapisxalpha
Copy link

This looks awesome, I downloaded the two.termux to try it out, but even though it runs android 14, the GoogleTV box I run Termux on with a bluetooth mouse and keyboard doesn't seem to work with multi-window. i've only seen it show up once, briefly, even though make all multi-window is turned on in developer options, and I've probably tried all of the relevant adb commands (but I'll still accept suggestions). Thanks for keeping the torch llt.

@robertkirkman
Copy link
Member

I can see that there is some documentation about Picture-in-Picture mode on GoogleTV with Android 14 on this page,

https://developer.android.com/training/tv/get-started/multitasking#run-pip

but I couldn't find any other examples of any kind of "multi window" support on Google TV, so to get multiple windows on screen at once that are fully interactable simultaneously, I guess you'd need to continue using Termux:Float, or use Termux:X11 which provides an alternative display server that implements its own multi-window mode inside a single Android window.

@lapisxalpha
Copy link

I can see that there is some documentation about Picture-in-Picture mode on GoogleTV with Android 14 on this page,

https://developer.android.com/training/tv/get-started/multitasking#run-pip

but I couldn't find any other examples of any kind of "multi window" support on Google TV, so to get multiple windows on screen at once that are fully interactable simultaneously, I guess you'd need to continue using Termux:Float, or use Termux:X11 which provides an alternative display server that implements its own multi-window mode inside a single Android window.

When I launched the two.termux from the taskbar app it asks for you to choose one of several window sizes, and it honored that size, but there is no window border/frame or titlebar with all of those icons, so although I could use the window content I couldn't move, resize, or min/max it. If it would be helpful I could maybe upload a screenshot. Sounds like an incomplete implementation of multi-window mode unless maybe there's some settings in adb.

Incidentally, is anyone aware what binaries are being run in the left and center windows shown in the image at the top of this page? Looks like some form of modified 'ls' and pipes or snakes. Thanks.

When i figure out a good matrix client, I'll be on.

@ozwaldorf
Copy link
Author

ozwaldorf commented Feb 24, 2026

@lapisxalpha Im not sure how Google tv supports multi-window, however it's fully working as expected on android 7 (split screen, no free-form possible), samsung dex in android 14 (pictured), the same device without dex active, my phone on android 15, and Quest 3 vr headsets

The window decorations are implemented by the host os, so if google TV doesn't add them (title bar, close, min/split/max icons) im afraid that functionality isn't possible to implement on the termux side.

Btw if you can open the side menu, there should be a new window button. Does it work for you to open another window at the same time?


The "ls" binary is eza, a popular replacement with colors, icons, and git integration

pipes.sh is the other window

@robertkirkman
Copy link
Member

robertkirkman commented Feb 24, 2026

@lapisxalpha The side menu is this screen, if you have a mouse, it should be possible to open by clicking and holding all the way at the left side of the window, then dragging while clicking rightward towards the center of the window.

image

This PR version of Termux has a button there which causes an additional Termux window to open, if you're able to access this menu, what happens if you click that?

@robertkirkman
Copy link
Member

When i figure out a good matrix client, I'll be on.

please join the Termux matrix here! https://matrix.to/#/#Termux:matrix.org

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants