@@ -40,9 +40,9 @@ def __init__(self, session=None, **kwargs):
4040 def __repr__ (self ):
4141 return "%s(%s %s:%s, %s)" % (
4242 self .__class__ .__name__ ,
43- self .get ( 'window_id' ) ,
44- self .get ( 'window_index' ) ,
45- self .get ( 'window_name' ) ,
43+ self .id ,
44+ self .index ,
45+ self .name ,
4646 self .session
4747 )
4848
@@ -86,7 +86,7 @@ def cmd(self, cmd, *args, **kwargs):
8686
8787 """
8888 if not any (arg .startswith ('-t' ) for arg in args ):
89- args = ('-t' , self .get ( 'window_id' ) ) + args
89+ args = ('-t' , self .id ) + args
9090
9191 return self .server .cmd (cmd , * args , ** kwargs )
9292
@@ -117,7 +117,7 @@ def select_layout(self, layout=None):
117117
118118 proc = self .cmd (
119119 'select-layout' ,
120- '-t%s:%s' % (self .get ('session_id' ), self .get ( 'window_index' ) ),
120+ '-t%s:%s' % (self .get ('session_id' ), self .index ),
121121 layout
122122 )
123123
@@ -142,8 +142,8 @@ def set_window_option(self, option, value):
142142
143143 process = self .cmd (
144144 'set-window-option' ,
145- '-t%s:%s' % (self .get ('session_id' ), self .get ( 'window_index' ) ),
146- # '-t%s' % self.get('window_id') ,
145+ '-t%s:%s' % (self .get ('session_id' ), self .index ),
146+ # '-t%s' % self.id ,
147147 option , value
148148 )
149149
@@ -153,7 +153,7 @@ def set_window_option(self, option, value):
153153 raise ValueError (
154154 'tmux set-window-option -t%s:%s %s %s\n ' % (
155155 self .get ('session_id' ),
156- self .get ( 'window_index' ) ,
156+ self .index ,
157157 option ,
158158 value
159159 ) +
@@ -263,8 +263,8 @@ def kill_window(self):
263263
264264 proc = self .cmd (
265265 'kill-window' ,
266- # '-t:%s' % self.get('window_id')
267- '-t%s:%s' % (self .get ('session_id' ), self .get ( 'window_index' ) ),
266+ # '-t:%s' % self.id
267+ '-t%s:%s' % (self .get ('session_id' ), self .index ),
268268 )
269269
270270 if proc .stderr :
@@ -283,7 +283,7 @@ def move_window(self, destination):
283283
284284 proc = self .cmd (
285285 'move-window' ,
286- '-s%s:%s' % (self .get ('session_id' ), self .get ( 'window_index' ) ),
286+ '-s%s:%s' % (self .get ('session_id' ), self .index ),
287287 '-t%s:%s' % (self .get ('session_id' ), destination ),
288288 )
289289
@@ -302,7 +302,7 @@ def select_window(self):
302302 :rtype: :class:`Window`
303303
304304 """
305- target = '%s:%s' % (self .get ('session_id' ), self .get ( 'window_index' ) ),
305+ target = '%s:%s' % (self .get ('session_id' ), self .index ),
306306 return self .session .select_window (target )
307307
308308 def select_pane (self , target_pane ):
@@ -318,7 +318,7 @@ def select_pane(self, target_pane):
318318 if target_pane in ['-l' , '-U' , '-D' , '-L' , '-R' ]:
319319 proc = self .cmd (
320320 'select-pane' ,
321- '-t%s' % self .get ( 'window_id' ) ,
321+ '-t%s' % self .id ,
322322 target_pane
323323 )
324324 else :
@@ -426,7 +426,6 @@ def attached_pane(self):
426426 if 'pane_active' in pane :
427427 # for now pane_active is a unicode
428428 if pane .get ('pane_active' ) == '1' :
429- # return Pane(window=self, **pane)
430429 return Pane (window = self , ** pane )
431430 else :
432431 continue
@@ -440,7 +439,7 @@ def _list_panes(self):
440439 p for p in panes if p ['session_id' ] == self .get ('session_id' )
441440 ]
442441 panes = [
443- p for p in panes if p ['window_id' ] == self .get ( 'window_id' )
442+ p for p in panes if p ['window_id' ] == self .id
444443 ]
445444 return panes
446445
0 commit comments