summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-04 21:13:42 +0000
committerevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-04 21:13:42 +0000
commite2c2b560f36abd25ef9655858e5db238051687c4 (patch)
treedcaf162af42afc30557896d251fb2d0ba50500c8 /chrome
parent545502257b49be0201057984bd39523d1b9c3793 (diff)
downloadchromium_src-e2c2b560f36abd25ef9655858e5db238051687c4.zip
chromium_src-e2c2b560f36abd25ef9655858e5db238051687c4.tar.gz
chromium_src-e2c2b560f36abd25ef9655858e5db238051687c4.tar.bz2
linux: opening a download should not reuse your terminal
When opening a text file, if the helper wants to just spawn "less" we want it to use a new window for it. BUG=18298 Review URL: http://codereview.chromium.org/159867 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22404 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/common/platform_util_linux.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/chrome/common/platform_util_linux.cc b/chrome/common/platform_util_linux.cc
index 7a4e92b..4e25bcf 100644
--- a/chrome/common/platform_util_linux.cc
+++ b/chrome/common/platform_util_linux.cc
@@ -17,9 +17,16 @@ void XDGOpen(const FilePath& path) {
std::vector<std::string> argv;
argv.push_back("xdg-open");
argv.push_back(path.value());
- base::file_handle_mapping_vector no_files;
+
base::environment_vector env;
env.push_back(std::make_pair("GTK_PATH", getenv("CHROMIUM_SAVED_GTK_PATH")));
+ // xdg-open can fall back on mailcap which eventually might plumb through
+ // to a command that needs a terminal. Set the environment variable telling
+ // it that we definitely don't have a terminal available and that it should
+ // bring up a new terminal if necessary. See "man mailcap".
+ env.push_back(std::make_pair("MM_NOTTTY", "1"));
+
+ base::file_handle_mapping_vector no_files;
base::ProcessHandle handle;
if (base::LaunchApp(argv, env, no_files, false, &handle))
ProcessWatcher::EnsureProcessGetsReaped(handle);