|
44 | 44 | interact with the most recently attached client you attached. When |
45 | 45 | testing, just run a ``tmux`` in shell and do what you have to do. |
46 | 46 |
|
| 47 | + fnmatch |
| 48 | + tmuxwrapper is intended to work with fnmatch compatible functions. If |
| 49 | + an fnmatch isn't working at the API level, please file an issue. |
| 50 | +
|
| 51 | + Limitations |
| 52 | + The client that is picked is most recently attached. For normal usage, |
| 53 | + this isn't an issue, but more much more advanced used cases, <0.5% of |
| 54 | + people may not be covered. |
| 55 | +
|
47 | 56 | """ |
48 | 57 | import kaptan |
49 | 58 | from sh import tmux as tmx, cut, ErrorReturnCode_1 |
@@ -640,13 +649,39 @@ def __repr__(self): |
640 | 649 |
|
641 | 650 | class Server(object): |
642 | 651 | ''' |
643 | | - holds information on live, running tmux server |
| 652 | + ``t`` global. stores information on live, running tmux server |
644 | 653 |
|
645 | 654 | Server.sessions [<Session>, ..] |
646 | 655 | Session.windows [<Window>, ..] |
647 | 656 | Window.panes [<Pane>, ..] |
648 | 657 | Pane |
649 | 658 |
|
| 659 | + Panes, Windows and Sessions which are populated with _TMUX MetaData. |
| 660 | +
|
| 661 | + This is an experimental design choice to just leave `-F` commands to give |
| 662 | + _TMUX information, decorate methods to throw an exception if it requires |
| 663 | + interaction with tmux |
| 664 | +
|
| 665 | + This way, with ._TMUX, session and window can be accessed as a property, |
| 666 | + and the session and window may be looked up dynamically. |
| 667 | +
|
| 668 | + The children inside a ``t`` object are created live. We should look into |
| 669 | + giving them context managers so:: |
| 670 | +
|
| 671 | + with Server.select_session(fnmatch): |
| 672 | + # have access to session object |
| 673 | + # note at this level fnmatch may have to be done via python |
| 674 | + # and list-sessions to retrieve object correctly |
| 675 | + session.la() |
| 676 | + with session.active_window() as window: |
| 677 | + # access to current window |
| 678 | + pass |
| 679 | + with session.find_window(fnmatch) as window: |
| 680 | + # access to tmux matches window |
| 681 | + with window.active_path() as pane: |
| 682 | + # access to pane |
| 683 | + pass |
| 684 | +
|
650 | 685 | ''' |
651 | 686 | def list_sessions(self): |
652 | 687 | pass |
|
0 commit comments