News for hackers. Stuff that matters.
Re:Pymux: a tmux clone in pure Python by paulddraper on Sunday January 03, 2016 @01:45PM (#10831680)
README.md is a good place to check:

Compared to tmux

To some extend, pymux is a clone of tmux. This means that all the default shortcuts are the same; the commands are the same or very similar, and even a simple configuration file could be the same. (There are some small incompatibilities.) However, we definitely don't intend to create a fully compatible clone. Right now, only a subset of the command options that tmux provides are supported.

Pymux implements a few improvements over tmux:

There is a completion menu for the command line. (At the bottom of the screen.) The command line has fish-style suggestions. Both Emacs and Vi key bindings for the command line and copy buffer are well developed, thanks to all the effort we have put earlier in prompt_toolkit. Search in the copy buffer is highlighted while searching. Every pane has its own titlebar. When several clients are attached to the same session, each client can watch a different window. When clients are watching different windows, every client uses the full terminal size. Support for 24bit true color. (Disabled by default: not all terminals support it. Use the --truecolor option at startup or during attach in order to enable it.) About the performance:

Tmux is written in C, which is obviously faster than Python. This is noticeable when applications generate a lot of output. Where tmux is able to give fast real-time output for, for instance find / or yes, pymux will process the output slightly slower, and in this case render the output only a few times per second to the terminal. Usually, this should not be an issue. If it is, Pypy should provide a significant speedup. The big advantage of using Python and prompt_toolkit is that the implementation of new features becomes very easy.

Re:Pymux: a tmux clone in pure Python by melted on Sunday January 03, 2016 @02:22PM (#10831870)
That doesn't answer the question though. Why not just add all (or some) of the aforementioned stuff to tmux? Tmux is an established, widely used piece of software. Any improvements would be much more appreciated there.
Re:Pymux: a tmux clone in pure Python by ymse on Sunday January 03, 2016 @02:54PM (#10832037)
You could say the same about screen vs tmux (or endless other software clones). Projects like these help drive innovation on both sides. Competition, if you like.

Besides, Pymux is Python while tmux is C. I'm sure you can appreciate that adding a Python API to tmux would be non-trivial, both code-wise and politically.

Re:Pymux: a tmux clone in pure Python by git-pull on Sunday January 03, 2016 @05:54PM (#10832974)
Author of tmuxp here, a python API and config manager on top of tmux(1).

You can see the quickstart at https://tmuxp.readthedocs.org/en/latest/quickstart_python.ht... and the API documentation at https://tmuxp.readthedocs.org/en/latest/api.html.

You can see the testcases we cover use real tmux sessions and monitor the state of the session / window / panes to assert the API functions correctly. https://github.com/tony/tmuxp/tree/master/tmuxp/testsuite

As for pymux, Jonathan Slenders' work on ptpython [1] and prompt_toolkit have been quite nice when working with shell_plus in django or debugging python projects. He's good in this area. Agreed that it's a nice thing to have pymux there.

And agreed that adding native language extensions (python, ruby, etc.) to tmux would be complicated code-wise and perhaps not in the spirit of what it aspires to be. That said, on the tmuxp side of things, a lot could be improved. For example, switching tmuxp to use control mode (-C) and filing smaller patches to expand control mode's events in tmux(1).

[1] https://github.com/jonathanslenders/ptpython

Re:Pymux: a tmux clone in pure Python by DannoHung on Sunday January 03, 2016 @03:34PM (#10832211)
In my experience, Screen is a crashy piece of garbage.

tmux is comparatively rock solid.

Re:Pymux: a tmux clone in pure Python by JustSomeNobody on Sunday January 03, 2016 @03:15PM (#10832134)
But what's the innovation? Adding the python API?
Re:Pymux: a tmux clone in pure Python by toolz on Sunday January 03, 2016 @04:22PM (#10832469)
Not everything has to innovate. I understand it would be more useful to you and I if it did innovate, but there isn't some prereq for posting to hacker news that your project has to be innovative.

I personally find this project interesting to see, although I won't be using it.

Re:Pymux: a tmux clone in pure Python by JustSomeNobody on Sunday January 03, 2016 @05:06PM (#10832729)
The comment I was replying to specifically mentioned it.
Re:Pymux: a tmux clone in pure Python by hueving on Sunday January 03, 2016 @05:57PM (#10832992)
Spend the 30 seconds required to read the ancestor comment explaining what it has enabled WRT prompt toolkit.
Re:Pymux: a tmux clone in pure Python by gnuvince on Sunday January 03, 2016 @06:01PM (#10833003)
Look at the list of features that pymux has that tmux doesn't.
Re:Pymux: a tmux clone in pure Python by JustSomeNobody on Sunday January 03, 2016 @08:49PM (#10833593)
That's innovative? Ok, for some loose def of innovation.
Re:Pymux: a tmux clone in pure Python by ta0967 on Tuesday January 05, 2016 @08:35AM (#10843141)
you seem to have confused innovation with invention. but that's beside the point. you seem to think that software needs to be either to deserve existance. looks like you're in the minority with that opinion, the rest of us is quite happy with iterative, gradual improvement. we consider it better than sticking with whatever the first shot at an implementation managed to hit.
Re:Pymux: a tmux clone in pure Python by foota on Sunday January 03, 2016 @05:46PM (#10832938)
It literally does. "The big advantage of using Python and prompt_toolkit is that the implementation of new features becomes very easy."
Re:Pymux: a tmux clone in pure Python by jzd on Sunday January 03, 2016 @03:15PM (#10832132)
Because doing it in C might be a waste of time
Re:Pymux: a tmux clone in pure Python by melted on Sunday January 03, 2016 @04:07PM (#10832394)
How so? You instantly get the benefits out to a huge user base.
Re:Pymux: a tmux clone in pure Python by jzd on Sunday January 03, 2016 @04:52PM (#10832654)
Same goes for Python
Re:Pymux: a tmux clone in pure Python by njharman on Sunday January 03, 2016 @05:01PM (#10832695)
Pure Python is the difference. It runs anywhere python runs. Same can't be said for a compiled C program.

It's maybe not a "big" why, or one you care about.

Re:Pymux: a tmux clone in pure Python by glesica on Sunday January 03, 2016 @05:31PM (#10832876)
Isn't the Python interpreter implemented in C? How could Python run someplace that C can't?
Re:Pymux: a tmux clone in pure Python by deadbeef404 on Sunday January 03, 2016 @06:11PM (#10833041)
I think he means the exact same Python script can be run directly on any environment that has Python installed if written correctly, in contrast to a C program which has to be recompiled on various environments to be able to run.
Re:Pymux: a tmux clone in pure Python by njharman on Monday January 04, 2016 @04:39PM (#10838874)
One of them is. And ability to interpret Python is requirement for any python program to be able to run. Being able to build and deploy a c lib is not.

So, someone has made python run on Foo platform, lets say a watch. If I have a pure python program I can run it on that watch with no more fuss. If I have to rely on a c library then I have to get that ported to Foo platform, maybe dealing with developer keys and making "authorized" signed binary, etc, etc. Pure python is orders of magnitude easier.

That is why "Pure Python" is a thing.

Several standard libs come in pure python and C versions cause pure python is an advantage / requirement for some use cases. And speed is for others.

Re:Pymux: a tmux clone in pure Python by wrenky on Monday January 04, 2016 @12:23PM (#10836863)
Python as a language is implemented on almost every platform out there- You can just take this source code and run it there, instead of compiling for the target hardware.
Re:Pymux: a tmux clone in pure Python by bch on Sunday January 03, 2016 @05:25PM (#10832843)
I'm not following you -- are you saying that Python runs where C doesn't, or something else ?
Re:Pymux: a tmux clone in pure Python by njharman on Monday January 04, 2016 @04:42PM (#10838899)
I'm saying Python is already installed in places that would require a lot of effort to port and compile C vs just running some.py file.

"python some.py" is (in some cases) vastly easier than porting/compiling/signing C code.