Skip to content

Commit

Permalink
Revert "winpty 0.2.0 -> 0.2.1"
Browse files Browse the repository at this point in the history
This reverts commit 680e80a.
  • Loading branch information
Tyriar committed Jul 17, 2016
1 parent 680e80a commit 374dde0
Show file tree
Hide file tree
Showing 83 changed files with 910 additions and 3,041 deletions.
6 changes: 3 additions & 3 deletions binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
# "I disabled those warnings because of winpty" - @peters (GH-40)
'msvs_disabled_warnings': [ 4506, 4530 ],
'include_dirs' : [
'deps/winpty/src/include',
'deps/winpty/include',
],
'dependencies' : [
'deps/winpty/src/winpty.gyp:winpty-agent',
'deps/winpty/src/winpty.gyp:winpty',
'deps/winpty/winpty.gyp:winpty-agent',
'deps/winpty/winpty.gyp:winpty',
],
'sources' : [
'src/win/pty.cc'
Expand Down
16 changes: 0 additions & 16 deletions deps/winpty/.gitattributes

This file was deleted.

10 changes: 0 additions & 10 deletions deps/winpty/.gitignore

This file was deleted.

14 changes: 9 additions & 5 deletions deps/winpty/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,11 @@ MINGW_CXXFLAGS += \
MINGW_LDFLAGS += -static -static-libgcc -static-libstdc++
UNIX_LDFLAGS += $(UNIX_LDFLAGS_STATIC)

include src/subdir.mk
include agent/subdir.mk
include debugserver/subdir.mk
include libwinpty/subdir.mk
include tests/subdir.mk
include unix-adapter/subdir.mk

all : $(ALL_TARGETS)

Expand All @@ -73,12 +77,12 @@ distclean : clean

.PHONY : default all tests install clean distclean

build/mingw/%.o : src/%.cc
build/mingw/%.o : %.cc
@echo Compiling $<
@mkdir -p $$(dirname $@)
@$(MINGW_CXX) $(MINGW_CXXFLAGS) -I src/include -c -o $@ $<
@$(MINGW_CXX) $(MINGW_CXXFLAGS) -I include -c -o $@ $<

build/unix/%.o : src/%.cc
build/unix/%.o : %.cc
@echo Compiling $<
@mkdir -p $$(dirname $@)
@$(UNIX_CXX) $(UNIX_CXXFLAGS) -I src/include -c -o $@ $<
@$(UNIX_CXX) $(UNIX_CXXFLAGS) -I include -c -o $@ $<
File renamed without changes.
4 changes: 2 additions & 2 deletions deps/winpty/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ winpty comes with a tool for collecting timestamped debugging output. To use
it:

1. Run ``winpty-debugserver.exe`` on the same computer as winpty.
2. Set the ``WINPTY_DEBUG`` environment variable to ``trace`` for the
``console.exe`` process and/or the process using ``libwinpty.dll``.
2. Set the ``WINPTY_DEBUG`` environment variable to 1 for the ``console.exe``
process and/or the process using ``libwinpty.dll``.

winpty also recognizes a ``WINPTY_SHOW_CONSOLE`` environment variable. Set it
to 1 to prevent winpty from hiding the console window.
Expand Down
108 changes: 0 additions & 108 deletions deps/winpty/RELEASES.md

This file was deleted.

2 changes: 1 addition & 1 deletion deps/winpty/VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.2.1
0.2
44 changes: 6 additions & 38 deletions deps/winpty/src/agent/Agent.cc → deps/winpty/agent/Agent.cc
Original file line number Diff line number Diff line change
Expand Up @@ -160,20 +160,6 @@ Agent::Agent(LPCWSTR controlPipeName,
SetConsoleCtrlHandler(NULL, FALSE);
SetConsoleCtrlHandler(consoleCtrlHandler, TRUE);

// Disable Quick Edit mode. The user has little control over winpty's
// console, and I think it's better to default it off for the sake of
// programs that care about mouse input.
DWORD mode = 0;
if (!GetConsoleMode(m_console->conin(), &mode)) {
trace("Agent startup: GetConsoleMode failed");
} else {
mode &= ~ENABLE_QUICK_EDIT_MODE;
if (!SetConsoleMode(m_console->conin(), mode)) {
trace("Agent startup: SetConsoleMode failed");
}
}

updateMouseInputFlags(true);
setPollInterval(25);
}

Expand Down Expand Up @@ -303,7 +289,7 @@ void Agent::handlePacket(ReadBuffer &packet)

int Agent::handleStartProcessPacket(ReadBuffer &packet)
{
BOOL success;
BOOL success;
ASSERT(m_childProcess == NULL);

std::wstring program = packet.getWString();
Expand All @@ -323,7 +309,11 @@ int Agent::handleStartProcessPacket(ReadBuffer &packet)
cmdlineArg = &cmdlineCopy[0];
}
LPCWSTR cwdArg = cwd.empty() ? NULL : cwd.c_str();
LPCWSTR envArg = env.empty() ? NULL : env.data();
LPCWSTR envArg = env.empty() ? NULL : env.c_str();

if(envArg != NULL && wcscmp(envArg, L"")) {
envArg = NULL;
}

STARTUPINFO sui;
PROCESS_INFORMATION pi;
Expand Down Expand Up @@ -374,29 +364,8 @@ void Agent::pollDataSocket()
}
}

void Agent::updateMouseInputFlags(bool forceTrace)
{
DWORD mode = 0;
GetConsoleMode(m_console->conin(), &mode);
bool newFlagMI = mode & ENABLE_MOUSE_INPUT;
bool newFlagQE = mode & ENABLE_QUICK_EDIT_MODE;
if (forceTrace ||
newFlagMI != m_consoleMouseInputEnabled ||
newFlagQE != m_consoleQuickEditEnabled) {
trace("CONIN mode: ENABLE_MOUSE_INPUT=%s ENABLE_QUICK_EDIT_MODE=%s",
newFlagMI ? "enabled" : "disabled",
newFlagQE ? "enabled" : "disabled");
}
m_consoleMouseInputEnabled = newFlagMI;
m_consoleQuickEditEnabled = newFlagQE;
m_consoleInput->setMouseInputEnabled(newFlagMI && !newFlagQE);
}

void Agent::onPollTimeout()
{
// Check the mouse input flag so we can output a trace message.
updateMouseInputFlags();

// Give the ConsoleInput object a chance to flush input from an incomplete
// escape sequence (e.g. pressing ESC).
m_consoleInput->flushIncompleteEscapeCode();
Expand Down Expand Up @@ -603,7 +572,6 @@ void Agent::syncConsoleContentAndSize(bool forceResize)
syncConsoleTitle();

const ConsoleScreenBufferInfo info = m_console->bufferInfo();
m_consoleInput->setMouseWindowRect(info.windowRect());

// If an app resizes the buffer height, then we enter "direct mode", where
// we stop trying to track incremental console changes.
Expand Down
3 changes: 0 additions & 3 deletions deps/winpty/src/agent/Agent.h → deps/winpty/agent/Agent.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ class Agent : public EventLoop, public DsrSender
int handleStartProcessPacket(ReadBuffer &packet);
int handleSetSizePacket(ReadBuffer &packet);
void pollDataSocket();
void updateMouseInputFlags(bool forceTrace=false);

protected:
virtual void onPollTimeout();
Expand All @@ -95,8 +94,6 @@ class Agent : public EventLoop, public DsrSender
private:
bool m_useMark;
Win32Console *m_console;
bool m_consoleMouseInputEnabled;
bool m_consoleQuickEditEnabled;
NamedPipe *m_controlSocket;
NamedPipe *m_dataSocket;
bool m_closingDataSocket;
Expand Down
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 374dde0

Please sign in to comment.