From 06108111403b40196cbb40e7ad3b2480e6dc48de Mon Sep 17 00:00:00 2001 From: hut Date: Sat, 7 May 2011 01:15:29 +0200 Subject: core.main: Forbid piping things into ranger --- ranger/core/main.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ranger/core/main.py b/ranger/core/main.py index ade3bab5..e6392387 100644 --- a/ranger/core/main.py +++ b/ranger/core/main.py @@ -24,10 +24,15 @@ def main(): import locale import os.path import ranger + import sys from ranger.core.shared import (EnvironmentAware, FileManagerAware, SettingsAware) from ranger.core.fm import FM + if not sys.stdin.isatty(): + sys.stderr.write("Error: Must run ranger from terminal\n") + raise SystemExit(1) + try: locale.setlocale(locale.LC_ALL, '') except: -- cgit 1.4.1-2-gfad0