summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--ranger/core/actions.py4
-rw-r--r--ranger/core/environment.py1
-rw-r--r--ranger/gui/displayable.py2
-rw-r--r--ranger/gui/ui.py5
4 files changed, 6 insertions, 6 deletions
diff --git a/ranger/core/actions.py b/ranger/core/actions.py
index 0d76f2e8..31098738 100644
--- a/ranger/core/actions.py
+++ b/ranger/core/actions.py
@@ -546,7 +546,7 @@ class Actions(FileManagerAware, EnvironmentAware, SettingsAware):
 		cwd = self.env.cwd
 		direction = Direction(dirarg)
 		pos, selected = direction.select(lst=cwd.files, current=cwd.pointer,
-				pagesize=self.env.termsize[0])
+				pagesize=self.ui.termsize[0])
 		cwd.pointer = pos
 		cwd.correct_pointer()
 		for item in selected:
@@ -967,7 +967,7 @@ class Actions(FileManagerAware, EnvironmentAware, SettingsAware):
 				offset = 1
 			pos, selected = direction.select(
 					override=narg, lst=cwd.files, current=cwd.pointer,
-					pagesize=self.env.termsize[0], offset=offset)
+					pagesize=self.ui.termsize[0], offset=offset)
 			cwd.pointer = pos
 			cwd.correct_pointer()
 		if mode == 'set':
diff --git a/ranger/core/environment.py b/ranger/core/environment.py
index 171f716b..153e4f55 100644
--- a/ranger/core/environment.py
+++ b/ranger/core/environment.py
@@ -21,7 +21,6 @@ class Environment(SettingsAware, SignalDispatcher):
 	copy = None
 	cmd = None
 	cut = None
-	termsize = None
 	history = None
 	directories = None
 	last_search = None
diff --git a/ranger/gui/displayable.py b/ranger/gui/displayable.py
index 8888d8bf..a70dd2ff 100644
--- a/ranger/gui/displayable.py
+++ b/ranger/gui/displayable.py
@@ -142,7 +142,7 @@ class Displayable(EnvironmentAware, FileManagerAware, CursesShortcuts):
 		"""Resize the widget"""
 		do_move = True
 		try:
-			maxy, maxx = self.env.termsize
+			maxy, maxx = self.fm.ui.termsize
 		except TypeError:
 			pass
 		else:
diff --git a/ranger/gui/ui.py b/ranger/gui/ui.py
index b0d3edc6..a0aa800f 100644
--- a/ranger/gui/ui.py
+++ b/ranger/gui/ui.py
@@ -57,6 +57,7 @@ class UI(DisplayableContainer):
 				os.environ['TERM'] = 'linux'
 				self.win = curses.initscr()
 		self.env.keymaps.use_keymap('browser')
+		self.termsize = self.win.getmaxyx()
 
 		DisplayableContainer.__init__(self, None)
 
@@ -259,8 +260,8 @@ class UI(DisplayableContainer):
 
 	def update_size(self):
 		"""resize all widgets"""
-		self.env.termsize = self.win.getmaxyx()
-		y, x = self.env.termsize
+		self.termsize = self.win.getmaxyx()
+		y, x = self.termsize
 
 		self.browser.resize(1, 0, y - 2, x)
 		self.taskview.resize(1, 0, y - 2, x)