@@ -36,14 +36,9 @@ def __init__(self, session=None, **kwargs):
3636 self .server = self .session .server
3737
3838 if not 'window_id' in kwargs :
39- if kwargs ['window_index' ]:
40- self ._window_id = kwargs ['window_index' ]
41- else :
42- raise ValueError ('Window requires a `window_id`' )
39+ raise ValueError ('Window requires a `window_id`' )
4340
44- if not 'window_index' in kwargs :
45- raise ValueError ('Window requires a `window_index`' )
46- self ._window_index = kwargs ['window_index' ]
41+ self ._window_id = kwargs ['window_id' ]
4742
4843 #self.server._update_windows()
4944
@@ -60,7 +55,7 @@ def __repr__(self):
6055 def _TMUX (self , * args ):
6156
6257 attrs = {
63- 'window_index ' : self ._window_index
58+ 'window_id ' : self ._window_id
6459 }
6560
6661 # from https://github.com/serkanyersen/underscore.py
@@ -285,6 +280,8 @@ def split_window(self, attach=True):
285280
286281 #'-t%s' % self.attached_pane().get('pane_id'),
287282 # 2013-10-18 LOOK AT THIS, rm'd it..
283+ logger .error (self .get ('session_id' ))
284+ logger .error (self .panes )
288285
289286 tmux_args = (
290287 '-t%s' % self .panes [0 ].get ('pane_id' ),
@@ -301,33 +298,11 @@ def split_window(self, attach=True):
301298
302299 # tmux < 1.7. This is added in 1.7.
303300 if pane .stderr :
304- if 'unknown option -- F' in pane .stderr [0 ]:
305- tmux_args = (
306- '-t%s' % self .panes [0 ].get ('pane_id' ),
307- )
308- if not attach :
309- tmux_args += ('-d' ,)
310- proc = self .tmux (
311- 'split-window' ,
312- '-P' ,
313- * tmux_args
314- )
315- if proc .stderr :
316- raise Exception (pane .stderr )
317-
318- pane = proc .stdout [0 ]
319- import re
320- pane_regex = re .compile (r"^(?P<session_name>.*):(?P<window_index>\d*?).(?P<pane_index>\d*?)$" )
321- m = re .match (pane_regex , pane )
322- pane = m .groupdict ()
323-
324- pane ['pane_id' ] = pane ['pane_index' ]
325-
326- #pane = dict(zip(['session_name', 'window_index'], pane[0].split(':')))
327-
328- # todo, this needs code to find the newest pane created
329- else :
330- raise Exception (pane .stderr )
301+ raise Exception (pane .stderr )
302+ if 'pane too small' in pane .stderr :
303+ pass
304+
305+ raise Exception (pane .stderr , self ._TMUX , self .panes )
331306 else :
332307 pane = pane .stdout [0 ]
333308
@@ -357,11 +332,13 @@ def _list_panes(self):
357332 panes = self .server ._update_panes ()._panes
358333
359334 panes = [
360- p for p in panes if p ['session_name ' ] == self .get ('session_name ' )
335+ p for p in panes if p ['session_id ' ] == self .get ('session_id ' )
361336 ]
337+ logger .error (self .get ('session_id' ))
362338 panes = [
363339 p for p in panes if p ['window_id' ] == self .get ('window_id' )
364340 ]
341+ logger .error (self .get ('window_id' ))
365342 return panes
366343
367344 @property
0 commit comments