@@ -137,6 +137,8 @@ def set_window_option(self, option, value):
137137 :type value: string or bool
138138 '''
139139
140+ self .server ._update_windows ()
141+
140142 if isinstance (value , bool ) and value :
141143 value = 'on'
142144 elif isinstance (value , bool ) and not value :
@@ -145,6 +147,7 @@ def set_window_option(self, option, value):
145147 process = self .tmux (
146148 'set-window-option' ,
147149 '-t%s:%s' % (self .get ('session_id' ), self .get ('window_index' )),
150+ #'-t%s' % self.get('window_id'),
148151 option , value
149152 )
150153
@@ -155,7 +158,7 @@ def set_window_option(self, option, value):
155158 if isinstance (process .stderr , list ) and len (process .stderr ) == int (1 ):
156159 process .stderr = process .stderr [0 ]
157160 raise ValueError (
158- 'tmux set-window-option -t%s %s %s\n ' % (self .get ('window_id ' ), option , value ) +
161+ 'tmux set-window-option -t%s:%s %s %s\n ' % (self .get ('session_id' ), self . get ( 'window_index ' ), option , value ) +
159162 process .stderr )
160163
161164 def show_window_options (self , option = None ):
@@ -242,6 +245,24 @@ def rename_window(self, new_name):
242245
243246 return self
244247
248+ def kill_window (self ):
249+ '''
250+ ``$ tmux kill-window``
251+
252+ Kill the current :class:`Window` object.
253+
254+ :param target_window: the ``target window``.
255+ :type target_window: string
256+ '''
257+
258+ proc = self .tmux ('kill-window' , '-t%s' % self .get ('window_id' ))
259+
260+ if proc .stderr :
261+ raise Exception (proc .stderr )
262+
263+ self .server ._update_windows ()
264+
265+
245266 def select_pane (self , target_pane ):
246267 '''
247268 ``$ tmux select-pane``
0 commit comments