Compare commits

...
295 Commits
Author SHA1 Message Date
Dane Jensen 4a91d5601e Merge branch 'master' into floating_panes 2026-07-02 12:10:44 -07:00
Dane Jensen 7de5eb1254 Merge branch 'master' into floating_panes 2026-07-01 14:37:05 -07:00
Dane Jensen 9e0ca948bf Fixed merge errors. 2026-06-29 15:34:45 -07:00
Dane Jensen 8e070f1a34 Merge branch 'master' into floating_panes 2026-06-29 15:25:54 -07:00
Dane Jensen 6ec0afe5f7 Merge branch 'master' into floating_panes 2026-06-22 11:32:30 -07:00
Dane Jensen 41e731fc51 Fixed keybind for toggling between floating and tiled. 2026-06-21 13:16:34 -07:00
Dane Jensen 19c8da04d0 Merge branch 'master' into floating_panes 2026-06-21 13:12:34 -07:00
Dane Jensen 8925000c42 Removed cmd-tile-float-pane.c after moving functionality into cmd-break-pane.c and cmd-join-pane.c 2026-06-20 12:35:36 -07:00
Dane Jensen 568c99be4e Removed cmd-tile-float-pane.c. 2026-06-20 12:32:35 -07:00
Dane Jensen 69fc42afc9 Floating and tiling functionality moved into break-pane and join-pane 2026-06-20 12:28:04 -07:00
Dane Jensen 19843cd826 bugfix
There is a signature and functionality mismatch with the recent merge in
`layout_floating_pane` that has been fixed. It now more gracefully
handles inputs.
2026-06-20 12:22:08 -07:00
Dane Jensen 4eb96fc144 Merge branch 'master' into floating_panes 2026-06-20 12:12:51 -07:00
Dane Jensen 3d396f13ed A few fixes. 2026-06-19 11:33:24 -07:00
Dane Jensen 7d8401d707 formatting fix. 2026-06-19 11:33:24 -07:00
Dane Jensen c3aac57dda Updated documentation. 2026-06-19 11:33:24 -07:00
Dane Jensen 5602571c01 Moved functionality to float and tile panes into break-pane and
`join-pane`.
2026-06-19 11:33:24 -07:00
Dane Jensen c04236052c Merge branch 'master' into floating_panes 2026-06-19 11:31:46 -07:00
Dane Jensen 584cafa284 fix(floating_panes): Fixed tiled cell detection and removed dead guard.
When checking for space to split a layout cell, the window pane associated with that cell is needed to check for options. This fixes an incomplete scan for that window pane while updating the documentation to be more clear. There was also a redundant guard that just added noise that is now removed.
2026-06-18 15:05:38 -07:00
Dane Jensen 8a4a150a1a Fixed tiled cell detection and removed dead guard. 2026-06-18 15:01:21 -07:00
Dane Jensen de41b93b73 Merge branch 'master' into floating_panes 2026-06-18 12:54:11 -07:00
Dane Jensen 4aa1dd3ae8 Merge pull request #5239 from daneofmanythings/fp--missing-flag-move-pane
fix(floating_panes): Added missing `-D` flag from `move-pane` .args field.
2026-06-17 15:01:03 -07:00
Dane Jensen be33d01663 Added missing -D flag from move-pane .args field. 2026-06-17 14:59:34 -07:00
Dane Jensen fdcb93a467 Merge branch 'master' into floating_panes 2026-06-17 14:32:01 -07:00
Dane Jensen c54f7ec95e Remove extra code. 2026-06-16 13:43:13 -07:00
Dane Jensen f8448764e2 Merge branch 'master' into floating_panes 2026-06-16 13:38:33 -07:00
Dane Jensen f71e81c483 Merge pull request #5230 from daneofmanythings/fp--is_visible
fix(floating_panes): changed `window_pane_visible` to `window_pane_is_visible`
2026-06-15 21:20:03 -07:00
Dane Jensen 9bd53b8565 changed window_pane_visible to window_pane_is_visible 2026-06-15 21:18:47 -07:00
Dane Jensen dde9dda1a4 Merge branch 'master' into floating_panes 2026-06-15 16:52:21 -07:00
Dane Jensen 55c8b0c2a7 Merge branch 'master' into floating_panes 2026-06-15 13:00:51 -07:00
Nicholas Marriott fd1fca51fa Remove old code. 2026-06-15 08:59:43 +01:00
Dane Jensen 00620b57eb Bug fix for parsing floating args. 2026-06-14 22:14:08 -07:00
Dane Jensen bba9f38636 Bug fix for parsing floating args. 2026-06-14 22:11:57 -07:00
Dane Jensen 9c37acd002 hide-pane and show-pane now use the new layout mechanics. 2026-06-14 21:57:11 -07:00
Dane Jensen 195a9b357a hide-pane and show-pane now use the new layout mechanics. 2026-06-14 21:48:03 -07:00
Dane Jensen cd4c4bf723 tile-pane and float-pane now use the new layout mechanics
The layout position of every cell is kept throughout the state changing actions, and can therefore be restored.
2026-06-14 20:07:42 -07:00
Dane Jensen e244be2540 Bug fixes and adjustments from feedback. 2026-06-14 20:02:24 -07:00
Dane Jensen 5dad31b06e slight renaming. 2026-06-14 19:59:41 -07:00
Dane Jensen 64ded18960 Updating tile-pane and float-pane to use new layout mechanics. 2026-06-14 19:59:37 -07:00
Dane Jensen 4dd496790a Merge branch 'master' into floating_panes 2026-06-14 19:54:43 -07:00
Dane Jensen db9e782d50 Merge branch 'master' into floating_panes 2026-06-12 12:07:41 -07:00
Dane Jensen d4869ebdc5 Enabled swapping with floating panes from the pane menu. 2026-06-11 14:57:37 -07:00
Dane Jensen d1fe0d449b Enabled swapping marked panes from the pane mouse menu. 2026-06-11 14:55:43 -07:00
Dane Jensen e2b52abd47 Merge pull request #5197 from daneofmanythings/fp--hidden-pane-flag-location
fix(floating_panes): Move the hidden panes format logic to their alphabetical positions.
2026-06-11 14:52:31 -07:00
Dane Jensen f58eb4dc0e put the hidden panes format specifiers in the correct positions. 2026-06-11 14:48:42 -07:00
Dane Jensen 8497b588a2 Merge master into floating_panes 2026-06-11 12:05:11 -07:00
Dane Jensen 57641f67dd Merge pull request #5193 from daneofmanythings/fp--swap-floating-panes
fix(floating_panes): `swap-pane` can now affect floating panes.
2026-06-10 23:35:16 -07:00
Dane Jensen b675c2149c This guard doesn't need to be here. Why restrict this? 2026-06-10 15:10:36 -07:00
Dane Jensen 4fbc30267c remove old logic. 2026-06-10 15:09:10 -07:00
Dane Jensen 2a830aa567 Merge branch 'master' into floating_panes 2026-06-10 12:47:50 -07:00
Dane Jensen 84229d4735 Floating layout cells can now be placed anywhere in the layout tree.
Allowing layout cells to exist anywhere in the layout tree will enable floating and tiling commands to restore position in the tree with little effort. This enables that by slightly altering the floating pane creation logic, and adding some utility functions. These functions will be soon be used elsewhere as well.
2026-06-09 22:59:13 +00:00
Dane Jensen e370ce5a00 Added function comment. 2026-06-09 15:44:24 -07:00
Dane Jensen 2a1ad05671 There was an bug with the earlier commit, reproduction: "splitw; newp
-t0; killp -t0". Added logic to handle previously unforseen states, like
a floating cell before a tiled cell at the top of the screen.
2026-06-09 15:37:30 -07:00
Dane Jensen 7568bff8e6 Layout cells for floating panes are now inserted after the cell of a
provided window pane.
2026-06-09 13:33:45 -07:00
Dane Jensen 6766c8ec1d Initial commit. 2026-06-09 13:33:45 -07:00
Dane Jensen 2955c1fdc7 Merge master into floating_panes. 2026-06-09 20:33:15 +00:00
Dane Jensen 45e9e541a4 Merge branch 'master' into fp-merge 2026-06-09 13:29:32 -07:00
Dane Jensen b2ac4475cc Merge pull request #5182 from daneofmanythings/fp-merge
Merging master into floating panes.
2026-06-08 23:01:12 +00:00
Dane Jensen a7952492c1 Merged master into floating_panes 2026-06-08 15:58:38 -07:00
Nicholas Marriott 0b1089e105 Merge branch 'master' into floating_panes 2026-06-04 14:10:25 +01:00
Dane Jensen 6b3bdaff97 The backporting of work on staging left a few scattered compile errors.
fix(floating_panes): Leftover compile errors
2026-06-04 00:51:01 +00:00
Dane Jensen 7c908bca7a Fixed vestigal compile errors 2026-06-03 17:46:29 -07:00
Nicholas Marriott 90ede52728 Merge branch 'master' into floating_panes 2026-06-02 20:36:08 +01:00
Nicholas Marriott 17974ea7a0 Merge branch 'master' into floating_panes 2026-06-01 21:36:29 +01:00
Nicholas Marriott 25852623f0 Merge branch 'master' into floating_panes 2026-06-01 21:30:20 +01:00
Michael Grant 446aa08286 Bug fix vertical position of scrollbar had wrong vertical offset when status-position top. 2026-06-01 20:52:51 +01:00
Michael Grant 12b3cc3750 Merge branch 'floating_panes' of github.com:tmux/tmux into floating_panes 2026-06-01 20:20:58 +01:00
Michael Grant 6dd288d459 Fix bug: pane-border-status top, can't resize floating panes by dragging the border. 2026-06-01 20:20:42 +01:00
Nicholas Marriott d8547fc721 Merge branch 'master' into floating_panes 2026-06-01 19:35:29 +01:00
Nicholas Marriott 68fdc4fcbe Merge branch 'master' into floating_panes 2026-06-01 15:28:25 +01:00
Nicholas Marriott 398cb6fb4a Merge branch 'master' into floating_panes 2026-06-01 12:20:03 +01:00
Nicholas Marriott 7302549903 Merge branch 'master' into floating_panes 2026-06-01 08:44:44 +01:00
Nicholas Marriott e971bc79d6 Merge branch 'master' into floating_panes 2026-05-30 12:48:11 +01:00
Nicholas Marriott 650ad28f12 Merge branch 'master' into floating_panes 2026-05-30 11:59:37 +01:00
Nicholas Marriott 2637477eea Merge branch 'master' into floating_panes 2026-05-30 09:28:19 +01:00
Nicholas Marriott e5c69afa98 Merge branch 'master' into floating_panes 2026-05-29 09:40:53 +01:00
Nicholas Marriott ec901e9e31 Merge branch 'master' into floating_panes 2026-05-28 12:54:25 +01:00
Nicholas Marriott d814529285 Merge branch 'master' into floating_panes 2026-05-28 12:07:54 +01:00
Nicholas Marriott 82dc3d57f2 Merge branch 'master' into floating_panes 2026-05-28 10:15:31 +01:00
Nicholas Marriott 3f77cb95c5 Change tty_draw_pane to draw in the right place I think. 2026-05-28 09:39:44 +01:00
Nicholas Marriott 68e9ff797c Merge branch 'master' into floating_panes 2026-05-28 09:39:25 +01:00
Nicholas Marriott 97ee6e2587 Break screen_write_collect_flush into some helper functions. 2026-05-28 08:24:54 +01:00
Nicholas Marriott e0215480cd Merge branch 'master' into floating_panes 2026-05-27 22:22:38 +01:00
Nicholas Marriott bd33d9c47d Merge branch 'master' into floating_panes 2026-05-27 22:21:39 +01:00
Nicholas Marriott 3a025d39db Merge branch 'master' into floating_panes 2026-05-27 21:43:14 +01:00
Nicholas Marriott 1ed454d102 Do not reduce the end position when removing padding. 2026-05-27 21:41:51 +01:00
Nicholas Marriott 52250d518d Redraw line directly for wide cells in screen_write_cell, fix up selection and
generally tidy.
2026-05-27 21:41:48 +01:00
Nicholas Marriott bfa2ff2bdf Remove unused variable. 2026-05-27 20:33:41 +01:00
Nicholas Marriott c62b27f014 Add a helper to replace a loop. 2026-05-27 20:33:03 +01:00
Nicholas Marriott 20cf0d3ea9 Merge branch 'master' into floating_panes 2026-05-27 20:27:48 +01:00
Nicholas Marriott 02caf7ce4a Remove a difference from master. 2026-05-27 19:36:20 +01:00
Nicholas Marriott e1c7367a2e Merge branch 'master' into floating_panes 2026-05-27 19:31:56 +01:00
Nicholas Marriott fc4641c5a5 Merge branch 'master' into floating_panes 2026-05-27 16:54:02 +01:00
Nicholas Marriott 8f9e2c7db2 Trivial tidying up of FP clears. 2026-05-27 14:30:57 +01:00
Nicholas Marriott 46be03d88e Clamp range with to size of window (visible ranges cannot be outside window). 2026-05-26 13:02:07 +01:00
Nicholas Marriott f9bd5eb79e If a pane is outside the window, treat as obscured. 2026-05-26 12:48:16 +01:00
Nicholas Marriott d89a4ab3df Redraw obscured panes instead of scrolling also. 2026-05-26 11:41:06 +01:00
Nicholas Marriott 57b18d8a18 Move redraw of overlapped panes into common functions. 2026-05-26 11:20:28 +01:00
Nicholas Marriott 95465ca03a Merge branch 'master' into floating_panes 2026-05-25 16:19:05 +01:00
Nicholas Marriott 6513808720 And a bad merge. 2026-05-25 15:50:25 +01:00
Nicholas Marriott 6c1773542d Some trivial bits from master. 2026-05-25 15:49:22 +01:00
Nicholas Marriott c60422241b Merge branch 'master' into floating_panes 2026-05-25 09:21:36 +01:00
Michael Grant 92dcb22e92 Clean up in screen_redraw_draw_pane and fix an offset bug. 2026-05-25 08:17:57 +01:00
Nicholas Marriott f75b1e5f07 Do not check overlays in tty_draw_line_clear, the caller should be doing it. 2026-05-24 12:25:51 +01:00
Nicholas Marriott fb9e47d8c9 Some chanegs I made in the wrong branch. 2026-05-24 12:10:46 +01:00
Nicholas Marriott 43ae6e0a6b tty_clear_area should not work out popup ranges because tty_clear_line is going
to do it anyway.
2026-05-24 12:07:42 +01:00
Nicholas Marriott 724d6d7c95 Change to fall into redraw for alignment test. 2026-05-24 11:43:35 +01:00
Michael Grant 95c20aef20 Fix the alignmenttest. 2026-05-24 11:22:44 +01:00
Nicholas Marriott 791f77b879 Some missing calls to tty_check_overlay_range. 2026-05-24 10:18:28 +01:00
Nicholas Marriott a6986864db Merge branch 'master' into floating_panes 2026-05-24 10:05:56 +01:00
Michael Grant 30866d06d5 Add visible range checks to screen_write.c functions and remove checks from tty.c. 2026-05-24 09:58:30 +01:00
Michael Grant 8b474429b7 Merge branch 'floating_panes' of github.com:tmux/tmux into floating_panes 2026-05-23 06:16:15 +01:00
Michael Grant 91b4e02805 Fix merge messup where i is no longer x, use px and ri->px instead here. 2026-05-23 06:15:12 +01:00
Nicholas Marriott e65e653ea5 Merge branch 'master' into floating_panes 2026-05-22 21:31:28 +01:00
Nicholas Marriott 29a1a1f8b0 Check overlay/BCE first to avoid walking panes unless needed. 2026-05-22 18:03:01 +01:00
Nicholas Marriott 71de737ee8 Merge branch 'master' into floating_panes 2026-05-22 17:10:08 +01:00
Nicholas Marriott 55fbacb469 Fix merge error. 2026-05-22 13:07:54 +01:00
Nicholas Marriott 2a6aac4c14 Merge branch 'master' into floating_panes 2026-05-22 12:44:49 +01:00
Nicholas Marriott 4fd8431ad0 Merge branch 'master' into floating_panes 2026-05-22 12:39:09 +01:00
Nicholas Marriott d3e8dd3623 Use a flags bit for obscured rather than an int. 2026-05-22 10:58:37 +01:00
Nicholas Marriott 1fa6ebacf4 Merge branch 'master' into floating_panes 2026-05-22 10:40:29 +01:00
Nicholas Marriott 8fa822207d Cache obscure flag in screen_write_ctx. 2026-05-22 09:07:38 +01:00
Nicholas Marriott 52ad3c8425 Change pane_is_obscured to take the context since it always uses its pane. 2026-05-22 09:03:51 +01:00
Nicholas Marriott e5abcd217c Start at the current pane in the zindex list for working out if a pane is
obscured.
2026-05-22 08:58:48 +01:00
Nicholas Marriott 4a0118aea1 Merge branch 'master' into floating_panes 2026-05-21 12:07:17 +01:00
Dane Jensen 90a748f7fb Added logic to prevent hidden panes from being selected as the window's active pane.
Additional logic added to find any valid pane if the best fit checks fail.
2026-05-20 19:33:30 +00:00
Dane Jensen 2434653867 fix: added conditionals and more finding logic to avoid displaying hidden panes. 2026-05-20 12:19:56 -07:00
Nicholas Marriott 1def587884 Remove code that was already applied. 2026-05-20 13:47:11 +01:00
Nicholas Marriott c56bc9ed05 Store pane ID for mouse last pane instead of a pointer to the pane. 2026-05-20 13:41:13 +01:00
Nicholas Marriott 2a9ba51907 Merge branch 'master' into floating_panes 2026-05-20 12:06:49 +01:00
Nicholas Marriott 406ae3d8a6 Remove some trivial differences. 2026-05-20 09:46:38 +01:00
Nicholas Marriott 8a674265f3 Merge branch 'master' into floating_panes 2026-05-20 09:35:03 +01:00
Dane Jensen ed43033c39 Changed the semantics from un/minimise-pane to hide/show-pane
Several functions and flags were semantically changed. No logic was altered.
2026-05-20 04:14:59 +00:00
Dane Jensen 0a7b008b21 Changed minimised semantics to hide semantics 2026-05-19 21:09:53 -07:00
Nicholas Marriott f8e908b89c More trivial merge errors. 2026-05-19 13:26:27 +01:00
Nicholas Marriott 2695c5305e More merge fixes. 2026-05-19 13:23:21 +01:00
Nicholas Marriott 55fdfef9d1 Merge fixes. 2026-05-19 13:19:21 +01:00
Nicholas Marriott 2f6da393e2 Merge branch 'master' into floating_panes 2026-05-19 13:05:14 +01:00
Nicholas Marriott 57b17bbb70 window_pane_move is not used. 2026-05-19 10:54:35 +01:00
Dane Jensen 7c23da598d Fixed null dereference in window.c:window_pane_float_geometry when there is no target wp.
Conditions for the bug: start tmux, run `minimise-pane; new-pane`. Now fixed.
2026-05-19 00:21:48 +00:00
Dane Jensen b7cc218a03 Fixed null dereference. 2026-05-18 17:14:19 -07:00
Dane Jensen 0ae8019e7f Better api design and abstraction for new-pane and split-window.
While working on #5043, feedback was given by @mgrant0 regarding api design that also required addressing in `new-pane` and `split-window`. This MR addresses that feedback (no subflags, flag restriction for semantic reasons, unified 'float' and 'tile' flags across commands).
2026-05-18 22:46:53 +00:00
Dane Jensen c3fc0229e5 style fixes 2026-05-18 15:41:28 -07:00
Dane Jensen 76196b8ffa Moved new-pane into split-window. 2026-05-18 13:48:50 -07:00
Nicholas Marriott fd4e683151 Merge branch 'master' into floating_panes 2026-05-18 11:10:09 +01:00
Nicholas Marriott 2b05d8531d Merge branch 'master' into floating_panes 2026-05-17 15:55:09 +01:00
Nicholas Marriott 8e966688a7 If outside floating pane, do not carry on to check as if tiled pane. 2026-05-17 15:49:21 +01:00
Michael Grant c4ec9234e9 Fix to ignore minimised panes when redoing the layout. 2026-05-15 18:23:39 +01:00
Michael Grant 2e0eabbf0a Fix screen_redraw_get_visible_ranges to ignore minimised panes. 2026-05-15 18:20:29 +01:00
Michael Grant 1b2435fab6 Fix bug where tty output of command outputing was getting written to the window aafter it was minimised. 2026-05-13 22:46:32 +01:00
Michael Grant 1ff3dafe4e Fix crash when minimising pane. 2026-05-13 22:28:14 +01:00
Nicholas Marriott 6b16e93f1b Merge branch 'master' into floating_panes 2026-05-12 12:38:31 +01:00
Nicholas Marriott b7467a3110 Merge pull request #5039 from daneofmanythings/layout-null-dereference
fix: fixed site of null dereference in layout.c
2026-05-12 10:27:54 +01:00
Nicholas Marriott 4224ecd2ab Merge pull request #5042 from daneofmanythings/floating_panes--two-panes-crash
fix(floating_panes): null dereference in `screen_redraw_two_panes` from `screen_redraw_border_arrows`
2026-05-01 12:54:38 +01:00
Dane Jensen e18c10d340 Passing in '&type' to avoid null dereference 2026-04-27 21:51:02 -07:00
Dane Jensen 0719dcf2e7 fixed site of null dereference in layout.c 2026-04-25 15:05:58 -07:00
Nicholas Marriott 3400a312dd Merge pull request #5026 from daneofmanythings/floating_panes--new-pane-doc-fixup
docs(floating_panes): A couple documentation fixes from #4979
2026-04-24 16:06:12 +03:00
Michael Grant b2f9144e10 Merge pull request #5029 from daneofmanythings/floating_panes--fix-join-pane
fix(floating_panes): Z-index related crashing in `join-pane`
2026-04-24 13:56:37 +01:00
Dane Jensen a74f173902 more. 2026-04-23 21:53:06 -07:00
Dane Jensen a1cd68e3f8 Fixed z-index related crash in join-pane 2026-04-23 20:23:50 -07:00
Dane Jensen eec2c19ad1 oversights. 2026-04-23 17:07:53 -07:00
Michael Grant 05fdd04262 Fix the z-index of the pane. (nic's fix.) 2026-04-24 00:49:22 +01:00
Nicholas Marriott 3e36ddbceb Merge pull request #4979 from daneofmanythings/floating_panes--new-pane
refactor: Combined the code for `split-window` and `new-pane`
2026-04-22 10:29:07 +03:00
Dane Jensen 0a55e5ca54 Fixed logical error in handing default cascading. 2026-04-17 12:44:50 -07:00
Dane Jensen a7ad0c4434 Option flag adjustment for eventual consistency. 2026-04-16 11:38:33 -07:00
Michael Grant 271bac5347 Merge branch 'master' into floating_panes 2026-04-15 23:26:02 -04:00
Dane Jensen 914ffc8887 touchup. 2026-04-15 12:33:08 -07:00
Dane Jensen 7a4e35e317 doc fix. 2026-04-14 13:08:19 -07:00
Dane Jensen 1bc85cb59e Adjustment from feedback and slight touchups. 2026-04-14 12:40:59 -07:00
Dane Jensen f992c68fd8 slight touchup 2026-04-13 22:04:08 -07:00
Dane Jensen 4bb7a86753 Tested the new commands and updated documentation. 2026-04-13 21:39:30 -07:00
Dane Jensen 950194fb63 Migrated cmd-split-window.c into cmd-new-pane.c for code reuse. 2026-04-06 20:10:15 -07:00
Michael Grant b528fc438c Merge. 2026-04-05 19:40:56 -04:00
Michael Grant 811604a663 Fix bugs with tiling floating panes. 2026-04-05 19:04:10 -04:00
Michael Grant 4232bf9e2f Add new tile-pane and float-pane commands. 2026-03-30 18:01:55 -04:00
Michael Grant 8a3620e438 Initial commit. 2026-03-30 17:47:28 -04:00
Michael Grant 1408861511 Fix minimise window gesture to be like MacOS and Windows where if you click an active window in the status line it minimises it and if its already minimised it unminimises it. The ux feel now is natural. 2026-03-28 09:25:19 +00:00
Michael Grant 44229e8af6 Fix a crash when clicking a floating pane in the status line which was minimised after it was made active by window-tree. Correct the way window-tree displays floating panes so they can be easily unminimmised. 2026-03-28 08:35:35 +00:00
Michael Grant d002323de2 Merge branch 'master' into floating_panes 2026-03-26 20:51:42 +00:00
Michael Grant 999c7246c3 Formatting. 2026-03-26 08:46:28 +00:00
Michael Grant c10a597bf0 add -R to be able to set floating pane inactive border style. 2026-03-24 18:15:24 +00:00
Michael Grant 75ed7b27c6 Add -S and -s options to style floating panes. 2026-03-24 17:49:55 +00:00
Michael Grant ef01e9daf8 Reviewed and removed the xxx fix-me comments. 2026-03-24 14:35:59 +00:00
Michael Grant 866cb2d16f Update tmux.1 man page to add new-pane floating pane section. 2026-03-24 14:29:26 +00:00
Michael Grant 6a62d49720 Add options to new-pane: -k -m message to wait for key before closing a floating pane. 2026-03-24 14:23:58 +00:00
Michael Grant f201d246fd Fix next-layout to ignore floating panes. 2026-03-24 12:41:04 +00:00
Michael Grant 0328fe44e4 Fix sixel image writing so that it is aware of floating panes. 2026-03-22 09:28:15 +00:00
Michael Grant bb85983a29 Merge pull request #4929 from daneofmanythings/floating_panes-pane_status_format
feat: Panes' status format now displays title/flag information
2026-03-20 09:46:44 +00:00
Michael Grant 4341d6a095 Merge branch 'master' into floating_panes 2026-03-20 08:05:13 +00:00
Michael Grant 10a9ce1ed2 Prohibit swapping 2 floating panes, that doesn't make sense. 2026-03-20 07:59:25 +00:00
Michael Grant 943490cfa1 Fix issue when a wp disappears in the middle of a drag event. 2026-03-20 07:49:49 +00:00
Michael Grant 7e6bbc63ab Fix a slew of possible int vs u_int bugs which would likely have caused an overflow crash. 2026-03-18 13:04:21 +00:00
Michael Grant 0d195698f8 Fix dispay bugs where the cursor was on a line that had 2 visible ranges because it was partially obscured by a floating pane. 2026-03-18 09:38:17 +00:00
Dane Jensen 08fd890a89 Added status format functionality to panes along with flags 2026-03-17 22:50:04 -07:00
Michael Grant ab0081294c Fix scrolling issue when a floating pane overlaps a tiled pane. 2026-03-17 17:08:02 +00:00
Michael Grant c42a939e98 Fix some int/u_int bugs and added some logging. 2026-03-17 17:05:57 +00:00
Michael Grant 6c9e2f7e6c Fix no cursor in popup. 2026-03-16 12:07:41 +00:00
Michael Grant 992f04f328 Merge branch 'master' into floating_panes 2026-03-16 09:12:08 +00:00
Michael Grant 8a90fce476 Fix for window size taller than tty. 2026-03-10 13:21:01 +00:00
Michael Grant e928e80a42 Fix scrollbar issue not respecting oy when window size taller than tty. 2026-03-09 16:28:06 +00:00
Michael Grant 28c04b21f6 Minor fixup. 2026-03-09 08:35:24 +00:00
Michael Grant 46427f1dd7 Merge branch 'master' into floating_panes 2026-03-09 08:31:58 +00:00
Michael Grant 528e856566 Merge pull request #4893 from daneofmanythings/floating_panes__float_format
feat(format variable): added format variable for floating panes.
2026-03-08 17:14:16 +00:00
Michael Grant 14a934d412 Fix screen clearing issue to surgically clear around floating panes. 2026-03-08 17:11:55 +00:00
Dane Jensen 0faed7aeb5 added format flag for floating panes. 2026-03-04 12:08:43 -08:00
Michael Grant 8e6450c8fc Merge branch 'master' into floating_panes 2026-03-04 13:16:52 +00:00
Michael Grant 6898e26a7a Fix bug with utf-8 extended characters not respecting visible range. 2026-02-24 01:19:24 +00:00
Michael Grant e2cf40ef99 Fix crash cause by not having a wp pointer in tty.c. 2026-02-23 08:08:31 +00:00
Michael Grant 96515c9f47 Merge branch 'master' into floating_panes 2026-02-18 09:28:38 +00:00
Michael Grant 96e18faa93 Merge branch 'master' into floating_panes 2026-02-11 09:40:21 +00:00
Michael Grant 476c6e89ad Check the overlay visible ranges when we have a tty and check the panes visible ranges when we have a wp. Overlays checked at tty level (for most part) and pane overlays checked at screen level where possible to keep separation of abstraction relatively clean. 2026-02-11 09:30:48 +00:00
Michael Grant b46a96d454 Second try with static visual_ranges using calloc. 2026-01-29 14:34:18 +00:00
Michael Grant f67cf7d053 Return static range as last resort. 2026-01-29 11:46:21 +00:00
Nicholas Marriott 2ad0f4a9e7 Merge branch 'master' into floating_panes 2026-01-29 08:43:41 +00:00
Michael Grant 1ec9ca497b Merge with visible_ranges banch. Convert visible_ranges to new style. 2026-01-28 15:26:00 +00:00
Michael Grant dd5d0f4f0c Merge master. 2026-01-23 09:29:39 +00:00
Nicholas Marriott d1a6ce8e7f Associate each visible_ranges with some other object (tty, popup_data, etc) so
it is easier to keep track of its lifecycle, but still avoid allocating for
each use.
2026-01-21 21:29:56 +00:00
Michael Grant b22537e8a4 Conflict resolve. 2026-01-21 19:36:05 +00:00
Michael Grant a25c14d472 Change overlay_ranges into visible_ranges. 2026-01-21 19:34:19 +00:00
Nicholas Marriott 7730d38339 Skip correct width when moving to next position. 2026-01-21 15:58:11 +00:00
Nicholas Marriott 58e498c9d3 Use right cell for empty check. 2026-01-21 15:35:33 +00:00
Nicholas Marriott 35485f2b5e Fix selection with tty_draw_line. 2026-01-21 12:23:46 +00:00
Nicholas Marriott b108653f02 Change overlay_ranges to visible_ranges. 2026-01-20 21:18:33 +00:00
Nicholas Marriott 25f72cf240 Rewrite tty_draw_line to be simpler and not to check overlay ranges. 2026-01-20 21:18:20 +00:00
Thomas Adam d1df8dcccc focus-follows-mouse: honour floating panes
Make sure the z-ordering of floating panes is honoured when
focus-follows-mouse is in use.
2026-01-09 19:00:17 +00:00
Michael Grant a50d00aa47 Merge pull request #4799 from tmux/master
Sync from master
2026-01-09 11:30:16 +01:00
Michael Grant 34add944f2 Merge branch 'master' into feature-floating-window-panes 2026-01-07 23:41:29 +01:00
Michael Grant 95f85efc49 Fix some of the offset issues when windows size is greater than tty size. 2026-01-07 22:28:23 +00:00
Michael Grant f2f6a05e2c Add cmd-minimise-pane.c 2026-01-06 16:44:38 +00:00
Michael Grant bd442a27ee Fix some redraw issues. Fix scrollbar left/right display issues. 2025-12-24 10:45:17 +00:00
Michael Grant 73c0eb96c3 Merge branch 'master' into feature-floating-window-panes 2025-12-18 23:14:59 +01:00
Michael Grant 6a4a4a432b Add support to minimise panes, both tiled and floating. New PREFIX _ key binding to minimise a pane. New functions minimise-pane and unminimise-pane. Add double-click on pane in status to minimise pane. Single click on pane in status unminimises pane. 2025-12-18 18:19:17 +00:00
Michael Grant 263529e886 Cleanup from previous commit. 2025-12-09 20:11:44 +00:00
Michael Grant 818797ff08 Fix scrolling issue that collided with PR #4738 Fix y offset of mouse if status at top. 2025-12-09 17:47:36 +00:00
Michael Grant d263dbe9dd Merge branch 'tmux:master' into feature-floating-window-panes 2025-12-09 13:35:31 +00:00
Michael Grant 67319ad9d9 Fix tty-clear-area and make aware of floating panes. 2025-12-09 13:34:26 +00:00
Michael Grant 2591df66cc Bugfix status line at top and floating panes. 2025-12-09 00:14:06 +00:00
Michael Grant 2ac78bccb5 Bugfix status line at top. 2025-12-08 15:01:54 +00:00
Michael Grant 47de44001e Merge changes from master. 2025-12-08 14:30:57 +00:00
Michael Grant eaa467618b 1. Rework floating panes to have a stub layout_cell, 2. Add new <..> format to list-windows & select-layout for floating anes, 3. Fix zooming to work with floating panes, 4. Fix several display issues. 2025-12-08 14:28:17 +00:00
Michael Grant ac01f15bfe Merge branch 'master' into feature-floating-window-panes 2025-12-06 21:14:38 +00:00
Michael Grant 5df5217e2e Merge branch 'tmux:master' into feature-floating-window-panes 2025-11-28 10:34:17 +00:00
Michael Grant a6ec2b76c2 Merge branch 'tmux:master' into feature-floating-window-panes 2025-11-19 14:23:05 +00:00
Michael Grant bc01b300c4 Merge branch 'tmux:master' into feature-floating-window-panes 2025-11-14 21:10:00 +00:00
Michael Grant c8d4d8cb66 Bugfix fix some uninitialised variable warnings. 2025-11-14 11:02:12 +01:00
Michael Grant 315202b007 Merge branch 'tmux:master' into feature-floating-window-panes 2025-11-14 09:29:06 +00:00
Michael Grant 7194fdca38 Fix many display problems with floating windows up against the window edge and borders of other windows and many off-by-one errors. 2025-11-10 23:07:06 +01:00
Michael Grant 31d0945059 Fix dragging a window to y==0 when pane border status enabled. window_get_active_at() needs to return the pane at the top of the window when called with y==0, otherwise it returns null as if there is no pane at the top line. 2025-11-10 23:04:03 +01:00
Michael Grant 466e79d572 Bugfix for size of pane_border status not properly clipping. 2025-11-07 22:53:42 +01:00
Michael Grant 3bb4f72a4b Add new key binding ctrl-b * to create new floating pane. New panes created at increasing offsets. 2025-11-07 12:25:59 +01:00
Michael Grant 329e9d54ab Add support for clicking on a floating pane border to make it active. Including bugfix to click bottom border of floating panes. 2025-11-07 11:43:41 +01:00
Michael Grant 9c45dd693b Comment cleanup. 2025-11-07 01:24:39 +01:00
Michael Grant cc671e4495 Fix mouse drag in copy-mode to properly select around floating panes. 2025-11-07 01:24:19 +01:00
Michael Grant 61ca158de1 Fix pane borders, including fixing 2 side-by-side or top-bottom panes with split coulering. 2025-11-06 12:16:45 +01:00
Michael Grant 7e0038c691 Bugfix split pane border colours. 2025-11-04 15:48:23 +01:00
Michael Grant 04792d0656 Bugfix, max margin should be right side of window. 2025-11-03 22:38:35 +01:00
Michael Grant 6c5cc40039 Bugfix, more changes to allow xoff and yoff to be int. 2025-11-03 21:56:15 +01:00
Michael Grant 6b462474f0 Bugfix so floating wp can be moved to top of window. 2025-11-02 11:52:21 +01:00
Michael Grant 9a061a2fee Bugfix floating panes display when off window edge. 2025-11-02 09:56:57 +01:00
Michael Grant 6dd552d689 Fix floating pane redraw bugs. Allow floating panes to be partly out of the window. This required changing xoff and yoff from u_int to int and it required a fair bit of casting for example when xoff is added to sx or comparing px to xoff. It makes sense for px and sx to be u_int since they refers to things which should never be negative. 2025-11-01 21:47:54 +01:00
Michael Grant 34e858ea05 Add support to drag and resize floating window panes. 2025-10-30 21:42:32 +01:00
Michael Grant 39d2839e37 Bugfix visible_ranges calculation, no longer need to inject vr into tty_draw_line. 2025-10-28 12:50:13 +00:00
Michael Grant 7980d00e8c Attempt to take care of case of partially obscured wide characters by floating panes. (Not yet tested!) 2025-10-28 11:01:27 +00:00
Michael Grant 25ce5b4281 Add separate z-index list. Each window has its own z-order list of panes now. 2025-10-28 08:07:32 +00:00
Michael Grant 0cd3ab6299 Fix active border colour if only floating panes in the window. 2025-10-27 23:35:53 +00:00
Michael Grant 28d038fb16 Bugfix calculation error on bottom border when pane border status on and scrollbar enabled. 2025-10-27 22:18:07 +00:00
Michael Grant 10dc308e6b Add checking the redraw of floating panes and the pane border status. 2025-10-27 21:28:31 +00:00
Michael Grant 6344bab6cc Fix typo with visible_ranges struct name. Add support for checking visual ranges to tty_draw_pane. 2025-10-27 19:54:21 +00:00
Michael Grant 984fbacccf Change the visible_ranges array to work more like the overlay_ranges array, except be able to grow. 2025-10-26 14:18:27 +00:00
Michael Grant cc83ca6628 Add new newp command. 2025-10-26 14:02:57 +00:00
Michael Grant 04fc6ea11b Renamed floating window panes simple new-pane. 2025-10-24 14:24:26 +01:00
Michael Grant 8a9e2fccbd Move floating window stuff to new file: cmd-new-pane.c. 2025-10-24 10:25:18 +01:00
Michael Grant cc1324e2d9 Cleanup and simplification. Array of visual ranges now just simple array. 2025-10-24 09:53:12 +01:00
Michael Grant b2226d1608 Add scrollbar width to right border calculation. 2025-10-24 00:06:18 +01:00
Michael Grant 8ce0af3fc9 Fix a fencepost error (not sure why wp->sy+1 isn't the border). 2025-10-23 23:59:49 +01:00
Michael Grant b315a6c3d1 Add mouse detection on top & left borders of floating panes. 2025-10-23 23:25:48 +01:00
Michael Grant baf642b7d2 window_redraw_active_switch now brings floating pane to front. Fix compile warning in window_add_pane. 2025-10-23 20:30:32 +01:00
Michael Grant 8db76e9057 Bugfix fix redraw of overlapping floating panes. 2025-10-23 18:05:04 +01:00
Michael Grant e3b7bf9b31 Add -x, -y, -w, -h args to set the xoff, yoff, sx, and sy of the pane. 2025-10-23 00:12:54 +01:00
Michael Grant 38724f2e86 Return error if you try to split a floating pane. 2025-10-22 23:37:58 +01:00
Michael Grant 65fc09fac9 Hide cursor behind floating panes. 2025-10-22 23:29:21 +01:00
Michael Grant 3197b715b3 Bugfix display of above-below windows with a floating pane. 2025-10-22 22:50:10 +01:00
Michael Grant 26362dfc72 Bugfix display of 2 side-by-side panes with overlapping floating pane. 2025-10-22 22:07:42 +01:00
Michael Grant 275781ce45 Merge branch 'feature-floating-window-panes' of github.com:mgrant0/tmux into feature-floating-window-panes 2025-10-21 09:17:13 +01:00
Michael Grant 72dbbfedce Manage visible ranges when drawing scrollbars. 2025-10-21 09:13:33 +01:00
Michael Grant a6c6eabb5a Merge branch 'tmux:master' into feature-floating-window-panes 2025-10-21 08:14:38 +01:00
Michael Grant 379e4d976c Fix scrolling, redraw, and borders of floating panes. 2025-10-19 14:11:08 +01:00
Michael Grant a6514e2656 Merge branch 'feature-floating-window-panes' of github.com:mgrant0/tmux into feature-floating-window-panes 2025-10-16 10:24:40 +01:00
Michael Grant 032af23e18 Merge branch 'tmux:master' into feature-floating-window-panes 2025-10-16 09:35:25 +01:00
Michael Grant b5f9293014 Possible fixes leak 2025-10-13 08:45:32 +01:00
Michael Grant a37db55689 Bugfix. 2025-10-12 10:38:47 +01:00
Michael Grant 1b959d0eff Cleanup before reworking collect_scroll. 2025-10-12 05:48:30 +01:00
Michael Grant ce03f1abea Cleanup - screen_redraw_get_visible_ranges returns a value rather than pass addr of arg. Bugfix to redraw code. 2025-10-11 18:07:22 +01:00
Michael Grant 5faf41b695 Add support in screen-write.c to properly display cmd output when there are floating panes on the screen. 2025-10-10 23:59:47 +01:00
Michael Grant 7634daa834 Add function screen_redraw_get_visual_ranges to figure out what parts of floating panes obscure a target pane being redrawn. 2025-10-06 22:19:25 +01:00
Michael Grant 968f439672 Initial commit. Add new new-floating-window command to create panes without a layout_cell indicating they are floating panes. 2025-10-04 09:15:51 +01:00
17 changed files with 663 additions and 62 deletions
+1
View File
@@ -102,6 +102,7 @@ dist_tmux_SOURCES = \
cmd-display-panes.c \
cmd-find-window.c \
cmd-find.c \
cmd-hide-pane.c \
cmd-if-shell.c \
cmd-join-pane.c \
cmd-kill-pane.c \
+4
View File
@@ -60,6 +60,10 @@ cmd_break_pane_float(struct cmdq_item *item, struct args *args,
cmdq_error(item, "pane is already floating");
return (CMD_RETURN_ERROR);
}
if (window_pane_is_hidden(wp)) {
cmdq_error(item, "can't float a hidden pane");
return (CMD_RETURN_ERROR);
}
if (w->flags & WINDOW_ZOOMED) {
cmdq_error(item, "can't float a pane while window is zoomed");
return (CMD_RETURN_ERROR);
+7 -2
View File
@@ -994,15 +994,20 @@ cmd_find_target(struct cmd_find_state *fs, struct cmdq_item *item,
} else if (cmd_find_from_client(&current, cmdq_get_client(item),
flags) == 0) {
fs->current = &current;
/* No active pane, window empty, return the window instead. */
if (current.wp == NULL) {
type = CMD_FIND_WINDOW;
}
log_debug("%s: current is from client", __func__);
} else {
if (~flags & CMD_FIND_QUIET)
cmdq_error(item, "no current target");
goto error;
}
/*
if (!cmd_find_valid_state(fs->current))
fatalx("invalid current find state");
*/
/* An empty or NULL target is the current. */
if (target == NULL || *target == '\0')
goto current;
@@ -1041,7 +1046,7 @@ cmd_find_target(struct cmd_find_state *fs, struct cmdq_item *item,
fs->w = fs->wl->window;
fs->wp = fs->w->active;
}
break;
goto found;
}
if (fs->wp == NULL) {
if (~flags & CMD_FIND_QUIET)
+213
View File
@@ -0,0 +1,213 @@
/* $OpenBSD$ */
/*
* Copyright (c) 2026 Michael Grant <mgrant@gmail.com>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
* IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include <sys/types.h>
#include <stdlib.h>
#include <string.h>
#include "tmux.h"
/*
* Hide or show panes.
*/
static enum cmd_retval cmd_hide_pane_exec(struct cmd *, struct cmdq_item *);
static enum cmd_retval cmd_show_pane_exec(struct cmd *, struct cmdq_item *);
const struct cmd_entry cmd_hide_pane_entry = {
.name = "hide-pane",
.alias = "hidep",
.args = { "at:", 0, 1, NULL },
.usage = "[-a] " CMD_TARGET_PANE_USAGE,
.target = { 't', CMD_FIND_PANE, 0 },
.flags = CMD_AFTERHOOK,
.exec = cmd_hide_pane_exec
};
const struct cmd_entry cmd_show_pane_entry = {
.name = "show-pane",
.alias = "showp",
.args = { "at:", 0, 1, NULL },
.usage = "[-a] " CMD_TARGET_PANE_USAGE,
.target = { 't', CMD_FIND_PANE, 0 },
.flags = CMD_AFTERHOOK,
.exec = cmd_show_pane_exec
};
static enum cmd_retval
cmd_hide_pane_hide(struct window *w, struct window_pane *wp)
{
struct window_pane *wpp = NULL;
struct layout_cell *lc = wp->layout_cell;
if (window_pane_is_hidden(wp))
return (CMD_RETURN_NORMAL);
if (wp == w->active) {
/* Find previous active pane. */
TAILQ_FOREACH(wpp, &w->last_panes, sentry) {
if (wpp != wp && window_pane_is_visible(wpp))
break;
}
if (wpp == NULL) {
TAILQ_FOREACH(wpp, &w->z_index, zentry) {
if (wpp != wp &&
window_pane_is_visible(wpp))
break;
}
}
}
lc->flags |= LAYOUT_CELL_HIDDEN;
layout_remove_tile(w, lc);
layout_fix_offsets(w);
layout_fix_panes(w, NULL);
window_pane_stack_remove(&w->last_panes, wp);
if (wpp != NULL) {
window_set_active_pane(w, wpp, 1);
} else if (wp == w->active) {
/* No visible previous active pane; null active pane
* to show dots background. */
w->active = NULL;
if (options_get_number(global_options, "focus-events"))
window_pane_update_focus(wp);
notify_window("window-pane-changed", w);
notify_window("window-layout-changed", w);
server_redraw_window(w);
} else {
notify_window("window-layout-changed", w);
server_redraw_window(w);
}
return (CMD_RETURN_NORMAL);
}
static enum cmd_retval
cmd_hide_pane_exec(struct cmd *self, struct cmdq_item *item)
{
struct args *args = cmd_get_args(self);
struct cmd_find_state *target = cmdq_get_target(item);
struct winlink *wl = target->wl;
struct window *w = wl->window;
struct window_pane *wp, *active_pane = w->active;
u_int id;
char *cause = NULL;
enum cmd_retval rv;
window_unzoom(w, 1);
if (args_has(args, 'a')) {
TAILQ_FOREACH(wp, &w->z_index, zentry) {
if (!window_pane_is_visible(wp) || wp == active_pane)
continue;
rv = cmd_hide_pane_hide(w, wp);
if (rv != CMD_RETURN_NORMAL)
return (rv);
}
return (CMD_RETURN_NORMAL);
} else {
wp = target->wp;
if (wp == NULL) {
id = args_strtonum_and_expand(args, 't', 0, INT_MAX,
item, &cause);
if (cause != NULL) {
cmdq_error(item, "%s target pane", cause);
return (CMD_RETURN_ERROR);
}
wp = window_pane_find_by_id(id);
}
if (wp == NULL) {
cmdq_error(item, "No target pane to hide.");
return (CMD_RETURN_ERROR);
}
return (cmd_hide_pane_hide(w, wp));
}
}
static enum cmd_retval
cmd_hide_pane_show(struct window *w, struct window_pane *wp)
{
struct layout_cell *lc = wp->layout_cell;
if (!window_pane_is_hidden(wp))
return (CMD_RETURN_NORMAL);
lc->flags &= ~LAYOUT_CELL_HIDDEN;
layout_insert_tile(w, lc);
layout_fix_offsets(w);
layout_fix_panes(w, NULL);
window_set_active_pane(w, wp, 1);
notify_window("window-layout-changed", w);
server_redraw_window(w);
return (CMD_RETURN_NORMAL);
}
static enum cmd_retval
cmd_show_pane_exec(struct cmd *self, struct cmdq_item *item)
{
struct args *args = cmd_get_args(self);
struct cmd_find_state *target = cmdq_get_target(item);
struct winlink *wl = target->wl;
struct window *w = wl->window;
struct window_pane *wp;
u_int id;
char *cause = NULL;
enum cmd_retval rv;
window_unzoom(w, 1);
if (args_has(args, 'a')) {
TAILQ_FOREACH(wp, &w->z_index, zentry) {
if (!window_pane_is_visible(wp))
continue;
rv = cmd_hide_pane_show(w, wp);
if (rv != CMD_RETURN_NORMAL)
return (rv);
}
return (CMD_RETURN_NORMAL);
} else {
wp = target->wp;
if (wp == NULL) {
id = args_strtonum_and_expand(args, 't', 0, INT_MAX,
item, &cause);
if (cause != NULL) {
cmdq_error(item, "%s target pane", cause);
return (CMD_RETURN_ERROR);
}
wp = window_pane_find_by_id(id);
}
if (wp == NULL) {
cmdq_error(item, "No target pane to show.");
return (CMD_RETURN_ERROR);
}
return (cmd_hide_pane_show(w, wp));
}
}
+50 -1
View File
@@ -363,6 +363,45 @@ cmd_join_pane_zindex(struct cmdq_item *item, struct winlink *wl,
return (CMD_RETURN_NORMAL);
}
static enum cmd_retval
cmd_join_pane_tile(struct cmdq_item *item, struct args *args, struct window *w,
struct window_pane *wp)
{
struct layout_cell *lc = wp->layout_cell;
if (!window_pane_is_floating(wp)) {
cmdq_error(item, "pane is not floating");
return (CMD_RETURN_ERROR);
}
if (window_pane_is_hidden(wp)) {
cmdq_error(item, "can't tile a hidden pane");
return (CMD_RETURN_ERROR);
}
if (w->flags & WINDOW_ZOOMED) {
cmdq_error(item, "can't tile a pane while window is zoomed");
return (CMD_RETURN_ERROR);
}
layout_save_size(lc);
lc->flags &= ~LAYOUT_CELL_FLOATING;
if (layout_insert_tile(w, lc) == 0) {
cmdq_error(item, "no space for a new pane");
return (CMD_RETURN_ERROR);
}
TAILQ_REMOVE(&w->z_index, wp, zentry);
TAILQ_INSERT_TAIL(&w->z_index, wp, zentry);
if (!args_has(args, 'd'))
window_set_active_pane(w, wp, 1);
layout_fix_offsets(w);
layout_fix_panes(w, NULL);
notify_window("window-layout-changed", w);
server_redraw_window(w);
return (CMD_RETURN_NORMAL);
}
static enum cmd_retval
cmd_join_pane_exec(struct cmd *self, struct cmdq_item *item)
{
@@ -377,7 +416,7 @@ cmd_join_pane_exec(struct cmd *self, struct cmdq_item *item)
const char *s;
char *cause = NULL;
int flags = 0, dst_idx;
struct layout_cell *lc;
struct layout_cell *lc, *src_lc;
dst_s = target->s;
dst_wl = target->wl;
@@ -408,9 +447,13 @@ cmd_join_pane_exec(struct cmd *self, struct cmdq_item *item)
src_wl = source->wl;
src_wp = source->wp;
src_lc = src_wp->layout_cell;
src_w = src_wl->window;
server_unzoom_window(src_w);
if (!args_has(args, 't') && window_pane_is_floating(src_wp))
return (cmd_join_pane_tile(item, args, src_w, src_wp));
if (src_wp == dst_wp) {
cmdq_error(item, "source and target panes must be different");
return (CMD_RETURN_ERROR);
@@ -422,6 +465,12 @@ cmd_join_pane_exec(struct cmd *self, struct cmdq_item *item)
free(cause);
return (CMD_RETURN_ERROR);
}
if (window_pane_is_floating(src_wp)) {
lc->saved_sx = src_lc->sx;
lc->saved_sy = src_lc->sy;
lc->saved_xoff = src_lc->xoff;
lc->saved_yoff = src_lc->yoff;
}
layout_close_pane(src_wp);
-6
View File
@@ -79,12 +79,6 @@ cmd_swap_pane_exec(struct cmd *self, struct cmdq_item *item)
if (src_wp == dst_wp)
goto out;
if (window_pane_is_floating(src_wp) ||
window_pane_is_floating(dst_wp)) {
cmdq_error(item, "cannot swap floating panes");
return (CMD_RETURN_ERROR);
}
server_client_remove_pane(src_wp);
server_client_remove_pane(dst_wp);
+4
View File
@@ -69,6 +69,7 @@ extern const struct cmd_entry cmd_load_buffer_entry;
extern const struct cmd_entry cmd_lock_client_entry;
extern const struct cmd_entry cmd_lock_server_entry;
extern const struct cmd_entry cmd_lock_session_entry;
extern const struct cmd_entry cmd_hide_pane_entry;
extern const struct cmd_entry cmd_move_pane_entry;
extern const struct cmd_entry cmd_move_window_entry;
extern const struct cmd_entry cmd_new_pane_entry;
@@ -106,6 +107,7 @@ extern const struct cmd_entry cmd_show_environment_entry;
extern const struct cmd_entry cmd_show_hooks_entry;
extern const struct cmd_entry cmd_show_messages_entry;
extern const struct cmd_entry cmd_show_options_entry;
extern const struct cmd_entry cmd_show_pane_entry;
extern const struct cmd_entry cmd_show_prompt_history_entry;
extern const struct cmd_entry cmd_show_window_options_entry;
extern const struct cmd_entry cmd_source_file_entry;
@@ -163,6 +165,7 @@ const struct cmd_entry *cmd_table[] = {
&cmd_lock_client_entry,
&cmd_lock_server_entry,
&cmd_lock_session_entry,
&cmd_hide_pane_entry,
&cmd_move_pane_entry,
&cmd_move_window_entry,
&cmd_new_pane_entry,
@@ -200,6 +203,7 @@ const struct cmd_entry *cmd_table[] = {
&cmd_show_hooks_entry,
&cmd_show_messages_entry,
&cmd_show_options_entry,
&cmd_show_pane_entry,
&cmd_show_prompt_history_entry,
&cmd_show_window_options_entry,
&cmd_source_file_entry,
+17
View File
@@ -2169,6 +2169,20 @@ format_cb_pane_height(struct format_tree *ft)
return (NULL);
}
/* Callback for pane_hidden_flag. */
static void *
format_cb_pane_hidden_flag(struct format_tree *ft)
{
struct window_pane *wp = ft->wp;
if (wp != NULL) {
if (window_pane_is_hidden(wp))
return (xstrdup("1"));
return (xstrdup("0"));
}
return (NULL);
}
/* Callback for pane_id. */
static void *
format_cb_pane_id(struct format_tree *ft)
@@ -3474,6 +3488,9 @@ static const struct format_table_entry format_table[] = {
{ "pane_height", FORMAT_TABLE_STRING,
format_cb_pane_height
},
{ "pane_hidden_flag", FORMAT_TABLE_STRING,
format_cb_pane_hidden_flag
},
{ "pane_id", FORMAT_TABLE_STRING,
format_cb_pane_id
},
+5 -2
View File
@@ -64,7 +64,7 @@
" ''" \
" '#{?#{&&:#{!:#{pane_floating_flag}},#{>:#{window_panes},1}},Swap Up,}' 'u' {swap-pane -U}" \
" '#{?#{&&:#{!:#{pane_floating_flag}},#{>:#{window_panes},1}},Swap Down,}' 'd' {swap-pane -D}" \
" '#{?#{!:#{pane_floating_flag}},#{?pane_marked_set,,-}Swap Marked,}' 's' {swap-pane}" \
" '#{?pane_marked_set,,-}Swap Marked' 's' {swap-pane}" \
" ''" \
" 'Kill' 'X' {kill-pane}" \
" 'Respawn' 'R' {respawn-pane -k}" \
@@ -350,6 +350,8 @@ key_bindings_init(void)
{
static const char *const defaults[] = {
/* Prefix keys. */
"bind -N 'Hide pane' _ { hide-pane }",
"bind -N 'Send the prefix key' C-b { send-prefix }",
"bind -N 'Rotate through the panes' C-o { rotate-window }",
"bind -N 'Suspend the current client' C-z { suspend-client }",
@@ -362,6 +364,7 @@ key_bindings_init(void)
"bind -N 'Kill current window' & { confirm-before -p\"kill-window #W? (y/n)\" kill-window }",
"bind -N 'Prompt for window index to select' \"'\" { command-prompt -T window-target -pindex { select-window -t ':%%' } }",
"bind -N 'New floating pane' * { new-pane }",
"bind -N 'Toggle pane between floating and tiled' @ { if -F '#{pane_floating_flag}' { join-pane } { break-pane -W } }",
"bind -N 'Switch to previous client' ( { switch-client -p }",
"bind -N 'Switch to next client' ) { switch-client -n }",
"bind -N 'Rename current window' , { command-prompt -I'#W' { rename-window -- '%%' } }",
@@ -473,7 +476,7 @@ key_bindings_init(void)
"bind -n M-MouseDrag1Border { move-pane -M }",
/* Mouse button 1 down on status line. */
"bind -n MouseDown1Status { switch-client -t= }",
"bind -n MouseDown1Status { if -F '#{&&:#{pane_active},#{!#{pane_hidden_flag}}}' { hide-pane -t= } { switch-client -t= } }",
"bind -n C-MouseDown1Status { swap-window -t@ }",
/* Mouse button 1 down on default pane-border-format */
+20 -3
View File
@@ -53,6 +53,7 @@ static u_int layout_new_pane_size(struct window *, u_int,
u_int);
static int layout_set_size_check(struct window *, struct layout_cell *,
enum layout_type, int);
static int layout_cell_has_tiled_child(struct layout_cell *);
static void layout_resize_child_cells(struct window *,
struct layout_cell *);
@@ -209,6 +210,16 @@ layout_set_size(struct layout_cell *lc, u_int sx, u_int sy, int xoff, int yoff)
lc->yoff = yoff;
}
void
layout_save_size(struct layout_cell *lc)
{
lc->saved_sx = lc->sx;
lc->saved_sy = lc->sy;
lc->saved_xoff = lc->xoff;
lc->saved_yoff = lc->yoff;
}
/* Make a cell a leaf cell. */
void
layout_make_leaf(struct layout_cell *lc, struct window_pane *wp)
@@ -444,7 +455,8 @@ layout_fix_panes(struct window *w, struct window_pane *skip)
status = window_get_pane_status(w);
TAILQ_FOREACH(wp, &w->panes, entry) {
if ((lc = wp->layout_cell) == NULL || wp == skip)
if ((lc = wp->layout_cell) == NULL || wp == skip ||
!window_pane_is_visible(wp))
continue;
old_xoff = wp->xoff;
@@ -698,7 +710,11 @@ layout_destroy_cell(struct window *w, struct layout_cell *lc,
struct layout_cell *lcother = NULL, *lcparent;
int change;
/* If no parent, this is the last pane in a window. */
/*
* If no parent, this is either a floating pane or the last
* pane so window close is imminent and there is no need to
* resize anything.
*/
lcparent = lc->parent;
if (lcparent == NULL) {
if (lc->wp != NULL)
@@ -737,6 +753,7 @@ out:
TAILQ_REMOVE(&lcparent->cells, lc, entry);
lc->parent = lcparent->parent;
if (lc->parent == NULL) {
if (layout_cell_is_tiled(lc)) {
lc->xoff = 0;
@@ -789,7 +806,7 @@ layout_resize(struct window *w, u_int sx, u_int sy)
* out proportionately - this should leave the layout fitting the new
* window size.
*/
if (lc->type == LAYOUT_WINDOWPANE && (lc->flags & LAYOUT_CELL_FLOATING))
if (!layout_cell_is_tiled(lc))
return;
xchange = sx - lc->sx;
xlimit = layout_resize_check(w, lc, LAYOUT_LEFTRIGHT);
+22
View File
@@ -1437,6 +1437,28 @@ const struct options_table_entry options_table[] = {
.text = "Character used to fill unused parts of window."
},
{ .name = "floating-pane-border-style",
.type = OPTIONS_TABLE_STRING,
.scope = OPTIONS_TABLE_WINDOW|OPTIONS_TABLE_PANE,
.default_str = "default",
.flags = OPTIONS_TABLE_IS_STYLE,
.separator = ",",
.text = "Default border style for floating panes. "
"Overrides pane-border-style for floating panes unless "
"a per-pane style is set."
},
{ .name = "floating-pane-style",
.type = OPTIONS_TABLE_STRING,
.scope = OPTIONS_TABLE_WINDOW|OPTIONS_TABLE_PANE,
.default_str = "default",
.flags = OPTIONS_TABLE_IS_STYLE,
.separator = ",",
.text = "Default content style for floating panes. "
"Overrides window-style for floating panes unless "
"a per-pane style is set."
},
{ .name = "main-pane-height",
.type = OPTIONS_TABLE_STRING,
.scope = OPTIONS_TABLE_WINDOW,
+14 -3
View File
@@ -147,6 +147,9 @@ screen_write_set_client_cb(struct tty_ctx *ttyctx, struct client *c)
if (wp->layout_cell == NULL)
return (0);
if (window_pane_is_hidden(wp))
return (0);
if (wp->flags & (PANE_REDRAW|PANE_DROP))
return (-1);
if (c->flags & CLIENT_REDRAWWINDOW) {
@@ -2225,8 +2228,11 @@ screen_write_collect_clear(struct screen_write_ctx *ctx, u_int y, u_int n)
struct screen_write_cline *cl;
u_int i;
log_debug("%s: clearing rows %u..%u", __func__, y, y + n - 1);
for (i = y; i < y + n; i++) {
cl = &ctx->s->write_list[i];
if (!TAILQ_EMPTY(&cl->items))
log_debug("%s: row %u had items!", __func__, i);
TAILQ_CONCAT(&screen_write_citem_freelist, &cl->items, entry);
}
}
@@ -2241,8 +2247,8 @@ screen_write_collect_scroll(struct screen_write_ctx *ctx, u_int bg)
char *saved;
struct screen_write_citem *ci;
log_debug("%s: at %u,%u (region %u-%u)", __func__, s->cx, s->cy,
s->rupper, s->rlower);
log_debug("%s: at %u,%u (region %u-%u) cy=%u", __func__, s->cx, s->cy,
s->rupper, s->rlower, s->cy);
screen_write_collect_clear(ctx, s->rupper, 1);
saved = ctx->s->write_list[s->rupper].data;
@@ -3084,9 +3090,14 @@ screen_write_sixelimage(struct screen_write_ctx *ctx, struct sixel_image *si,
}
screen_write_collect_flush(ctx, 0, __func__);
screen_write_initctx(ctx, &ttyctx, 0, 0);
screen_write_initctx(ctx, &ttyctx, 0, 1);
ttyctx.image = image_store(s, si);
if ((ttyctx.flags & TTY_CTX_PANE_OBSCURED) && ctx->wp != NULL) {
ctx->wp->flags |= PANE_REDRAW;
return;
}
tty_write(tty_cmd_sixelimage, &ttyctx);
screen_write_cursormove(ctx, 0, cy + y, 0);
+82
View File
@@ -292,6 +292,8 @@ Rename the current session.
Split the current pane into two, left and right.
.It &
Kill the current window.
.It @
Toggle the current pane between floating and tiled.
.It \[aq]
Prompt for a window index to select.
.It \&(
@@ -3249,6 +3251,21 @@ is omitted and a marked pane is present (see
.Ic select\-pane
.Fl m ) ,
the marked pane is used rather than the current pane.
.Pp
If
.Ar dst\-pane
is not specified and
.Ar src\-pane
is floating, return the pane back to the tiled layout.
Half the space from the nearest tiled pane in the layout tree is given to
.Ar src\-pane .
The floating position and sizes are saved so they can be restored if
.Ar src\-pane
is floated again.
If
.Fl d
is given, the active pane is not changed.
The pane must be floating, not hidden, and the window must not be zoomed.
.Tg killp
.It Xo Ic kill\-pane
.Op Fl a
@@ -3417,6 +3434,23 @@ or
(time).
.Fl r
reverses the sort order.
.Tg hidep
.It Xo Ic hide\-pane
.Op Fl a
.Op Fl t Ar target\-pane
.Xc
.D1 Pq alias: Ic hidep
Hide
.Ar target\-pane
from the tiled layout without closing it.
The pane continues to run but is no longer visible and does not occupy any
screen space.
Hidden panes are shown in the status line and can be restored with
.Ic show\-pane .
With
.Fl a ,
all visible panes in the window are hidden.
The pane must not already be hidden.
.Tg movep
.It Xo Ic move\-pane
.Op Fl bdfhMv
@@ -4146,6 +4180,17 @@ is omitted and a marked pane is present (see
.Ic select\-pane
.Fl m ) ,
the window containing the marked pane is used rather than the current window.
.Tg showp
.It Xo Ic show\-pane
.Op Fl t Ar target\-pane
.Xc
.D1 Pq alias: Ic showp
Restore a hidden
.Ar target\-pane
to the tiled layout.
Space is redistributed equally among all visible panes at the same layout
level after the pane is restored.
The pane must be hidden.
.Tg unlinkw
.It Xo Ic unlink\-window
.Op Fl k
@@ -5617,6 +5662,42 @@ Set clock hour format.
.It Ic fill\-character Ar character
Set the character used to fill areas of the terminal unused by a window.
.Pp
.It Ic floating\-pane\-border\-style Ar style
Set the default border style for all floating panes in the window.
This overrides
.Ic pane-border-style
for floating panes.
A per-pane style set with
.Fl S
on the
.Ic new\-pane
command or with
.Ic set-option Fl p
takes priority over this option.
For how to specify
.Ar style ,
see the
.Sx STYLES
section.
.Pp
.It Ic floating\-pane\-style Ar style
Set the default content style for all floating panes in the window.
This overrides
.Ic window-style
for floating panes.
A per-pane style set with
.Fl s
on the
.Ic new\-pane
command or with
.Ic select-pane Fl P
takes priority over this option.
For how to specify
.Ar style ,
see the
.Sx STYLES
section.
.Pp
.It Ic main\-pane\-height Ar height
.It Ic main\-pane\-width Ar width
Set the width or height of the main (left or top) pane in the
@@ -7076,6 +7157,7 @@ The following variables are available, where appropriate:
.It Li "pane_left" Ta "" Ta "Left of pane"
.It Li "pane_marked" Ta "" Ta "1 if this is the marked pane"
.It Li "pane_marked_set" Ta "" Ta "1 if a marked pane is set"
.It Li "pane_hidden_flag" Ta "" Ta "1 if pane is hidden"
.It Li "pane_mode" Ta "" Ta "Name of pane mode, if any"
.It Li "pane_path" Ta "" Ta "Path of pane (can be set by application)"
.It Li "pane_pid" Ta "" Ta "PID of first process in pane"
+7 -1
View File
@@ -1277,6 +1277,7 @@ struct window_pane {
int yoff;
int flags;
int saved_flags;
#define PANE_REDRAW 0x1
#define PANE_DROP 0x2
#define PANE_FOCUSED 0x4
@@ -1507,7 +1508,8 @@ TAILQ_HEAD(layout_cells, layout_cell);
struct layout_cell {
enum layout_type type;
#define LAYOUT_CELL_FLOATING 0x1
#define LAYOUT_CELL_FLOATING 0x1
#define LAYOUT_CELL_HIDDEN 0x2
int flags;
struct layout_cell *parent;
@@ -3664,6 +3666,7 @@ int window_pane_get_pane_status(struct window_pane *);
struct style_range *window_pane_status_get_range(struct window_pane *, u_int,
u_int);
int window_pane_is_floating(struct window_pane *);
int window_pane_is_hidden(struct window_pane *);
/* window-border.c */
void window_get_border_cell(struct window *, struct window_pane *,
@@ -3687,10 +3690,13 @@ void layout_free_cell(struct layout_cell *, int);
void layout_print_cell(struct layout_cell *, const char *, u_int);
void layout_destroy_cell(struct window *, struct layout_cell *,
struct layout_cell **);
void layout_hide_cell(struct window *, struct layout_cell *);
void layout_show_cell(struct window *, struct layout_cell *);
void layout_resize_layout(struct window *, struct layout_cell *,
enum layout_type, int, int);
struct layout_cell *layout_search_by_border(struct layout_cell *, u_int, u_int);
void layout_set_size(struct layout_cell *, u_int, u_int, int, int);
void layout_save_size(struct layout_cell *);
void layout_make_leaf(struct layout_cell *, struct window_pane *);
void layout_make_node(struct layout_cell *, enum layout_type);
void layout_fix_zindexes(struct window *, struct layout_cell *);
+162 -22
View File
@@ -2156,20 +2156,169 @@ tty_cmd_rawstring(struct tty *tty, const struct tty_ctx *ctx)
}
#ifdef ENABLE_SIXEL
/*
* Render one sub-rectangle of a sixel image at tty position (dst_x, dst_y).
* Caller must have set tty->flags |= TTY_NOBLOCK and called tty_region_off
* and tty_margin_off. After the call, tty->cx and tty->cy are UINT_MAX
* because the cursor position after a sixel DCS sequence is terminal-defined.
*/
static void
tty_sixel_subrect(struct tty *tty, struct sixel_image *si,
u_int src_i, u_int src_j, u_int src_rx, u_int src_ry,
u_int dst_x, u_int dst_y)
{
struct sixel_image *sub;
char *data;
size_t size;
if (src_rx == 0 || src_ry == 0)
return;
sub = sixel_scale(si, tty->xpixel, tty->ypixel,
src_i, src_j, src_rx, src_ry, 0);
if (sub == NULL)
return;
data = sixel_print(sub, si, &size);
sixel_free(sub);
if (data == NULL)
return;
tty_cursor(tty, dst_x, dst_y);
tty_add(tty, data, size);
tty->cx = tty->cy = UINT_MAX;
free(data);
}
/*
* Render the clamped region of sixel image si, split into sub-rectangles
* that avoid cells obscured by floating panes above this one.
*
* Row breakpoints are computed from each floating pane's top/bottom border
* row. Between breakpoints the visible column ranges are constant, so each
* strip is rendered with one set of sub-rectangles. When no floating panes
* overlap the sixel the loop produces a single strip and one sub-rect equal
* to the full clamped rectangle.
*
* i, j : source cell offset (top-left of visible portion after viewport clip)
* rx, ry: rendered size in cells
* x, y : tty destination position
*/
static void
tty_sixelimage_draw(struct tty *tty, const struct tty_ctx *ctx,
struct sixel_image *si, u_int i, u_int j, u_int rx, u_int ry,
u_int x, u_int y)
{
struct window_pane *wp, *fp;
struct window *w;
struct visible_ranges *vr;
struct visible_range *ri;
u_int sixel_wx0, sixel_wx1, sixel_y0;
u_int breaks[64], nb, b, s, tmp;
u_int strip_start, strip_end, strip_h;
u_int seg_wx0, seg_wx1, seg_w;
u_int src_i2, src_j2, dst_x2;
int fp_tb, fp_bb1, r_top, r_bot;
tty->flags |= TTY_NOBLOCK;
tty_region_off(tty);
tty_margin_off(tty);
wp = ctx->arg;
if (wp == NULL) {
/* Overlay/popup: no pane context, render the full clamped rect. */
tty_sixel_subrect(tty, si, i, j, rx, ry, x, y);
tty_invalidate(tty);
return;
}
/*
* sixel_y0 is the window y-coordinate of the first rendered row.
* Derived from tty_clamp_area: y = ctx->yoff + ocy + j - ctx->woy,
* so y + ctx->woy = ctx->yoff + ocy + j.
*/
w = wp->window;
sixel_wx0 = x + ctx->wox;
sixel_wx1 = sixel_wx0 + rx;
sixel_y0 = y + ctx->woy;
nb = 0;
breaks[nb++] = 0;
breaks[nb++] = ry;
TAILQ_FOREACH(fp, &w->z_index, zentry) {
if (!window_pane_is_floating(fp))
continue;
fp_tb = (int)((fp->yoff > 0) ? fp->yoff - 1 : 0);
fp_bb1 = (int)fp->yoff + (int)fp->sy + 1;
r_top = fp_tb - (int)sixel_y0;
r_bot = fp_bb1 - (int)sixel_y0;
if (r_top > 0 && (u_int)r_top < ry && nb < 62)
breaks[nb++] = (u_int)r_top;
if (r_bot > 0 && (u_int)r_bot < ry && nb < 62)
breaks[nb++] = (u_int)r_bot;
}
/* Sort breakpoints (insertion sort; small array). */
for (b = 1; b < nb; b++) {
tmp = breaks[b];
s = b;
while (s > 0 && breaks[s - 1] > tmp) {
breaks[s] = breaks[s - 1];
s--;
}
breaks[s] = tmp;
}
if (nb > 2)
log_debug("%s: sixel %%%u clipped around floating panes",
__func__, wp->id);
for (b = 0; b + 1 < nb; b++) {
strip_start = breaks[b];
strip_end = breaks[b + 1];
if (strip_end == strip_start)
continue;
strip_h = strip_end - strip_start;
vr = screen_redraw_get_visible_ranges(wp, ctx->xoff,
sixel_y0 + strip_start, wp->sx, NULL);
for (s = 0; s < vr->used; s++) {
ri = &vr->ranges[s];
if (ri->nx == 0)
continue;
seg_wx0 = ri->px;
seg_wx1 = ri->px + ri->nx;
if (seg_wx0 < sixel_wx0)
seg_wx0 = sixel_wx0;
if (seg_wx1 > sixel_wx1)
seg_wx1 = sixel_wx1;
if (seg_wx1 <= seg_wx0)
continue;
seg_w = seg_wx1 - seg_wx0;
src_i2 = i + (seg_wx0 - sixel_wx0);
src_j2 = j + strip_start;
dst_x2 = seg_wx0 - ctx->wox;
tty_sixel_subrect(tty, si, src_i2, src_j2,
seg_w, strip_h, dst_x2, y + strip_start);
}
}
tty_invalidate(tty);
}
void
tty_cmd_sixelimage(struct tty *tty, const struct tty_ctx *ctx)
{
struct image *im = ctx->image;
struct sixel_image *si = im->data;
struct sixel_image *new;
char *data;
size_t size;
u_int cx = ctx->ocx, cy = ctx->ocy, sx, sy;
u_int i, j, x, y, rx, ry;
int fallback = 0;
int fallback;
fallback = 0;
if ((~tty->term->flags & TERM_SIXEL) &&
!tty_term_has(tty->term, TTYC_SXL))
!tty_term_has(tty->term, TTYC_SXL))
fallback = 1;
if (tty->xpixel == 0 || tty->ypixel == 0)
fallback = 1;
@@ -2180,30 +2329,20 @@ tty_cmd_sixelimage(struct tty *tty, const struct tty_ctx *ctx)
return;
log_debug("%s: clamping to %u,%u-%u,%u", __func__, i, j, rx, ry);
if (fallback == 1) {
if (fallback) {
data = xstrdup(im->fallback);
size = strlen(data);
} else {
new = sixel_scale(si, tty->xpixel, tty->ypixel, i, j, rx, ry, 0);
if (new == NULL)
return;
data = sixel_print(new, si, &size);
}
if (data != NULL) {
log_debug("%s: %zu bytes: %s", __func__, size, data);
tty->flags |= TTY_NOBLOCK;
tty_region_off(tty);
tty_margin_off(tty);
tty_cursor(tty, x, y);
tty->flags |= TTY_NOBLOCK;
tty_add(tty, data, size);
tty_invalidate(tty);
free(data);
return;
}
if (fallback == 0)
sixel_free(new);
tty_sixelimage_draw(tty, ctx, si, i, j, rx, ry, x, y);
}
#endif
@@ -3121,7 +3260,6 @@ tty_style_changed(struct window_pane *wp)
{
struct options *oo = wp->options;
struct format_tree *ft;
struct style *sy;
log_debug("%%%u: style changed", wp->id);
wp->flags &= ~PANE_STYLECHANGED;
@@ -3130,12 +3268,14 @@ tty_style_changed(struct window_pane *wp)
format_defaults(ft, NULL, NULL, NULL, wp);
tty_window_default_style(&wp->cached_active_gc, wp);
sy = style_add(&wp->cached_active_gc, oo, "window-active-style", ft);
wp->cached_active_dim = sy->dim;
style_add(&wp->cached_active_gc, oo, "window-active-style", ft);
if (window_pane_is_floating(wp))
style_add(&wp->cached_active_gc, oo, "floating-pane-style", ft);
tty_window_default_style(&wp->cached_gc, wp);
sy = style_add(&wp->cached_gc, oo, "window-style", ft);
wp->cached_dim = sy->dim;
style_add(&wp->cached_gc, oo, "window-style", ft);
if (window_pane_is_floating(wp))
style_add(&wp->cached_active_gc, oo, "floating-pane-style", ft);
format_free(ft);
}
+1 -1
View File
@@ -345,7 +345,7 @@ window_tree_build_window(struct session *s, struct winlink *wl,
if (data->type == WINDOW_TREE_SESSION ||
data->type == WINDOW_TREE_WINDOW)
expanded = 0;
expanded = window_has_floating_panes(wl->window);
else
expanded = 1;
mti = mode_tree_add(data->data, parent, item, (uint64_t)wl, name, text,
+54 -21
View File
@@ -554,7 +554,8 @@ window_pane_update_focus(struct window_pane *wp)
int
window_set_active_pane(struct window *w, struct window_pane *wp, int notify)
{
struct window_pane *lastwp;
struct window_pane *lastwp;
struct layout_cell *lc;
log_debug("%s: pane %%%u", __func__, wp->id);
@@ -568,8 +569,19 @@ window_set_active_pane(struct window *w, struct window_pane *wp, int notify)
window_pane_stack_push(&w->last_panes, lastwp);
w->active = wp;
w->active->active_point = next_active_point++;
w->active->flags |= PANE_CHANGED;
wp->active_point = next_active_point++;
wp->flags |= PANE_CHANGED;
lc = wp->layout_cell;
if (window_pane_is_hidden(wp)) {
lc->flags &= ~LAYOUT_CELL_HIDDEN;
layout_insert_tile(w, lc);
layout_fix_offsets(w);
layout_fix_panes(w, NULL);
}
notify_window("window-layout-changed", w);
server_redraw_window(w);
if (options_get_number(global_options, "focus-events")) {
window_pane_update_focus(lastwp);
@@ -755,8 +767,6 @@ window_zoom(struct window_pane *wp)
if (w->flags & WINDOW_ZOOMED)
return (-1);
if (window_count_panes(w, 1) == 1)
return (-1);
if (w->active != wp)
window_set_active_pane(w, wp, 1);
@@ -863,26 +873,41 @@ window_add_pane(struct window *w, struct window_pane *other, u_int hlimit,
void
window_lost_pane(struct window *w, struct window_pane *wp)
{
struct window_pane *wpp, *twpp;
log_debug("%s: @%u pane %%%u", __func__, w->id, wp->id);
if (wp == marked_pane.wp)
server_clear_marked();
window_pane_stack_remove(&w->last_panes, wp);
if (wp == w->active) {
w->active = TAILQ_FIRST(&w->last_panes);
if (w->active == NULL) {
w->active = TAILQ_PREV(wp, window_panes, entry);
if (w->active == NULL)
w->active = TAILQ_NEXT(wp, entry);
}
if (w->active != NULL) {
window_pane_stack_remove(&w->last_panes, w->active);
w->active->flags |= PANE_CHANGED;
notify_window("window-pane-changed", w);
window_update_focus(w);
if (wp != w->active)
return;
/* Try to find a good fit. */
wpp = TAILQ_FIRST(&w->last_panes);
if (wpp == NULL || window_pane_is_hidden(wpp)) {
wpp = TAILQ_PREV(wp, window_panes, entry);
if (wpp == NULL || window_pane_is_hidden(wpp))
wpp = TAILQ_NEXT(wp, entry);
}
/* Try to find any fit. */
if (wpp == NULL || window_pane_is_hidden(wpp)) {
TAILQ_FOREACH_SAFE(wpp, &w->panes, entry, twpp) {
if (wpp != wp && !window_pane_is_hidden(wpp))
break;
}
}
if (wpp != NULL && window_pane_is_hidden(wpp))
wpp = NULL;
w->active = wpp;
if (w->active != NULL) {
window_pane_stack_remove(&w->last_panes, w->active);
w->active->flags |= PANE_CHANGED;
notify_window("window-pane-changed", w);
window_update_focus(w);
}
redraw_invalidate_scene(w);
}
@@ -1045,6 +1070,9 @@ window_pane_printable_flags(struct window_pane *wp)
flags[pos++] = 'Z';
if (window_pane_is_floating(wp))
flags[pos++] = 'F';
if (window_pane_is_hidden(wp))
flags[pos++] = 'm';
flags[pos] = '\0';
return (flags);
}
@@ -1689,8 +1717,11 @@ window_pane_key(struct window_pane *wp, struct client *c, struct session *s,
int
window_pane_is_visible(struct window_pane *wp)
{
if (window_pane_is_hidden(wp))
return (0);
if (~wp->window->flags & WINDOW_ZOOMED)
return (1);
return (wp == wp->window->active);
}
@@ -2539,9 +2570,11 @@ window_pane_get_pane_status(struct window_pane *wp)
int
window_pane_is_floating(struct window_pane *wp)
{
struct layout_cell *lc = wp->layout_cell;
return (wp->layout_cell->flags & LAYOUT_CELL_FLOATING);
}
if (lc == NULL || (lc->flags & LAYOUT_CELL_FLOATING) == 0)
return (0);
return (1);
int
window_pane_is_hidden(struct window_pane *wp)
{
return (wp->layout_cell->flags & LAYOUT_CELL_HIDDEN);
}