This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: TTYfier


Thanks for the reply...

On Sun, 17 Dec 2006 10:29:02 -0600, Egor Duda <deo@corpit.ru> wrote:

Eric Mangold wrote:

First of all, i think it's better to post it to cygwin mailing list.

I'm trying to use ttyfier to make the native win32 build of Python play
nice over a cygwin/ssh/bash shell. I can ssh in to my Windows machine and
run the Native python but it has all kinds of issues dealing with
interactive input/output.


Why not use cygwin version of python? It's much better integrated with
cygwin shells than native one.

The purpose of my setup is to provide a Windows development environment to other developers on the Twisted project. Most Twisted committers are running Linux or MacOS X, and while we fully support Twisted on win32, few developers have Windows boxes with which to work.


The basic workflow is editing python files with vim or emacs, and writing and running test cases with trial (our test runner). So a UNIX shell is basically perfect for doing this work: Enter Cygwin and SSH. The problem is that we have to use Native win32 Python otherwise developers aren't actually running and testing on a Native win32 platform. Cygwin is a different environment.

The alternative is to log in graphically with Remote Desktop, and while that does work a simple shell environment would be ideal.



I compiled ttyfier successfuly, but it unfortunately didn't solve my
problem. Running Python under tfy causes it to print the normal Python
prompt, then it just hangs and won't respond to any input.

I figured I would email you just in case you had some idea about what
might be going wrong.


I can guess that you're logging in to your cygwin machine from the unix
host, right?

Well I was using Putty, but I suspect that counts too.


If this is the case, then you're (almost, see below) out of luck.
Ttyfier uses special feature of cygwin console, called "raw-mode input".
tfy.exe sends special command to console application, which makes
console pass each your keypress, encoded, to tfy.exe. It then parses it
and send to the application it's running.

If you ssh from xterm on unix machine to cygwin host, run tfy.exe, then
your xterm continues sending "cooked" keypresses, instead of "raw" ones,
and tfy ignores them.

So to be able to use tfy.exe, your console application must be
'ttyfier-compatible', that is, it must support raw mode of input, which
tfy.exe can understand. If you've been compiling latest sources of
ttyfier, you may have noticed file x11_trans.c inside. This is
experimental module to parse raw input from specially patched xterm (I'm
attaching my old patch to xterm sources).

So, to run your python application from unix machine via ssh you have 2
options:

1. Run cygwin version of python.

2. a. Apply attached patch to xterm sources, and compile special version
 of xterm.
   b. Build tfy using wide-character version of libncurses
(libncursesw), so that tfy can correctly display pseudo-graphic
characters in unicode xterm window.

Which one is easier, is up to you. I must admit that since i've moved
from windows to linux several years ago, i have not much motivation to
push raw-mode patches to xterm or rxvt.

egor.

Thanks for your time. I've got a few things to try now and will report back with the results.


If anyone else has any ideas, no matter how crazy, I would like to hear them :)

Cheers,
--
Eric Mangold

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]