diff options
author | hut <hut@lavabit.com> | 2011-05-07 01:15:29 +0200 |
---|---|---|
committer | hut <hut@lavabit.com> | 2011-05-07 01:15:29 +0200 |
commit | 06108111403b40196cbb40e7ad3b2480e6dc48de (patch) | |
tree | dbd132488e2ed66f69ca41cb061606d3dce5d626 | |
parent | 288290fcbca607c2c8d11b550ea4029ebff91acf (diff) | |
download | ranger-06108111403b40196cbb40e7ad3b2480e6dc48de.tar.gz |
core.main: Forbid piping things into ranger
-rw-r--r-- | ranger/core/main.py | 5 |
1 files changed, 5 insertions, 0 deletions
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: |