Skip to content

Commit

Permalink
set TERM=dumb in posix terminal slave process
Browse files Browse the repository at this point in the history
  • Loading branch information
jjallaire committed Nov 22, 2011
1 parent efabeb0 commit 17082e9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/cpp/core/include/core/system/Process.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@ struct ProcessOptions
#ifdef _WIN32
: terminateChildren(false), detachProcess(false)
#else
: terminateChildren(false),
detachSession(false)
: terminateChildren(false), detachSession(false)
#endif
{
}
Expand Down
10 changes: 9 additions & 1 deletion src/cpp/session/modules/SessionPosixShell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
#include <core/Error.hpp>
#include <core/Exec.hpp>
#include <core/system/Process.hpp>
#include <core/system/Environment.hpp>

#include <session/SessionModuleContext.hpp>

Expand All @@ -66,15 +67,22 @@ class PosixShell : boost::noncopyable
int maxLines,
boost::shared_ptr<PosixShell>* ppPosixShell)
{
// create posix shell and bind callbacks
boost::shared_ptr<PosixShell> pShell(new PosixShell(maxLines));

core::system::ProcessCallbacks cb;
cb.onContinue = boost::bind(&PosixShell::onContinue, pShell, _1);
cb.onStdout = boost::bind(&PosixShell::onStdout, pShell, _2);
cb.onExit = boost::bind(&PosixShell::onExit, pShell, _1);

// configure environment for shell
core::system::Options shellEnv;
core::system::environment(&shellEnv);
core::system::setenv(&shellEnv, "TERM", "dumb");

// set options and run process
core::system::ProcessOptions options;
options.pseudoterminal = core::system::Pseudoterminal(width, 1);
options.environment = shellEnv;
Error error = module_context::processSupervisor().runCommand("/bin/sh",
options,
cb);
Expand Down

0 comments on commit 17082e9

Please sign in to comment.