Skip to content

Commit 726cf0e

Browse files
committed
remove Session.is_clean
1 parent 32ff66e commit 726cf0e

File tree

2 files changed

+0
-44
lines changed

2 files changed

+0
-44
lines changed

tmuxp/session.py

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -267,12 +267,6 @@ def select_window(self, target_window):
267267
268268
Todo: assure ``-l``, ``-n``, ``-p`` work.
269269
'''
270-
# if isinstance(target_window, int):
271-
# target = '-t%s:%s' % (self.get('session_name'), target_window)
272-
# elif isinstance(target_window, basestring):
273-
# target = '-t%s:%s' % (self.get('session_name'), target_window)
274-
# else:
275-
# target = '-t%s' % target_window
276270

277271
target = '-t%s' % target_window
278272

@@ -289,30 +283,6 @@ def attached_pane(self):
289283
'''
290284
return self.attached_window().attached_pane()
291285

292-
def is_clean(self):
293-
''' check if current session is pure, untouched:
294-
295-
- 1 window
296-
- 1 pane, no history.
297-
298-
returns True or False.
299-
'''
300-
if (len(self._windows) > 1):
301-
logger.debug('%s not clean, multiple windows', self)
302-
return False
303-
304-
if (len(self.attached_window()._panes) > 1):
305-
logger.debug('%s not clean, multiple panes (%s)' % (
306-
self, len(self.attached_window()._panes)))
307-
return False
308-
309-
if (int(self.attached_window().attached_pane().get('history_size')) > 0):
310-
logger.debug('%s history_size (%s), greater than 0' % (
311-
self, self.attached_window().attached_pane().get('history_size')))
312-
return False
313-
314-
return True
315-
316286
def set_option(self, option, value):
317287
'''
318288
wrapper for ``tmux(1)``::

tmuxp/testsuite/test_session.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -89,20 +89,6 @@ def test_session_rename(self):
8989
)
9090

9191

92-
class SessionCleanTest(TmuxTestCase):
93-
94-
def test_is_session_clean(self):
95-
'''Session.is_clean() returns False for sessions with previous commands'''
96-
97-
self.assertEqual(self.session.is_clean(), True)
98-
self.session.attached_window().attached_pane().send_keys('top')
99-
sleep(.4)
100-
self.session.attached_window().list_panes()
101-
self.session.attached_window().attached_pane().send_keys(
102-
'C-c', enter=False)
103-
self.assertEqual(self.session.is_clean(), False)
104-
105-
10692
class SessionNewTest(TmuxTestCase):
10793

10894
def test_new_session(self):

0 commit comments

Comments
 (0)