Sublime Forum

SublimePTY [pre-alpha]

#1

SublimePTY pre-alpha

https://github.com/wuub/SublimePTY

because I’m lazy and decided that keeping this hidden slows down development.

This is real terminal emulation that was once meant to be part of SublimeREPL, but after a bit of thought, I decided those two things are very different and should be separate.

Disclaimer: DON’T USE IT FOR ANYTHING. It’s PRE alpha and I mean it, some keys don’t even work yet!!!

Changelog:
0.2.0

  • most of the functions for beta version on windows are now ready
    Known problems:
    • console_server.py still needs to be started/killed manually
    • capitalized letters are broken
      Short screencast: http://www.youtube.com/watch?v=eaGBVdlqTko)
      I’m am super tired, and didn’t know what I was doing but it should be pretty obvious what works and what doesn’t. Most of the delays is me thinking what to do next or waiting for buffer to resize (ATM resizing is done each 2 seconds or so))

0.1.0

  • Prototype Windows console is in :wink:

0.0.6

  • shell job control is now enabled
  • also, ctrl-c works as expected
0 Likes

#2

Couldn’t get it to start on my mac. (And it froze the window entirely)
Console output: Traceback (most recent call last): File "./sublime_plugin.py", line 327, in run_ File "./sublimepty.py", line 20, in run File "./process.py", line 107, in __init__ File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/UserDict.py", line 22, in __getitem__ raise KeyError(key) KeyError: 'USERNAME' Traceback (most recent call last): File "./sublimepty.py", line 9, in read_all File "./process.py", line 24, in read_all File "./process.py", line 149, in _read AttributeError: 'PtyProcess' object has no attribute '_poll' Traceback (most recent call last): File "./sublimepty.py", line 9, in read_all File "./process.py", line 24, in read_all File "./process.py", line 149, in _read AttributeError: 'PtyProcess' object has no attribute '_poll'

P.S. WTF! Default.sublime-keymap is 2529 lines long.

0 Likes

#3

Bugfix pushed. I am too used to dictionaries that return None when key is missing.

Yes. They said “you can’t intercept all keys in a sublime view”, and I said: “we will see” :smiley:

0 Likes

#4

Thanks for the quickfix. That fixed one of the errors. I’m still getting: Traceback (most recent call last): File "./sublime_plugin.py", line 327, in run_ File "./sublimepty.py", line 20, in run File "./process.py", line 117, in __init__ AttributeError: 'module' object has no attribute 'poll'

Hahaha

0 Likes

#5

Oh, it seems that select.poll() is missing on OSX. atomized.org/2008/12/python-on-o … electpoll/
Nice, I love when this happens. Looking for a way to replace select.poll() with select.select() or something else

0 Likes

#6

[quote]select.poll()
(Not supported by all operating systems.) Returns a polling object, which supports registering and unregistering file descriptors, and then polling them for I/O events; see section Polling Objects below for the methods supported by polling objects.[/quote]

docs.python.org/library/select.html

It can’t be that important, right?

0 Likes

#7

I was able to replace it with select.select() which hopefully is available on OSX.
It is important, non blocking reads are quite nice :wink:

EDIT:
I think I’ll launch OSX now and do the rest of todays dev on it instead of Ubuntu.

0 Likes

#8

Awesome, it works now. I’ll report back when I break it again :smile:

0 Likes

#9

it works great with zsh :smiley:

0 Likes

#10

Really feeling the loser in windows loser right now :frowning:

0 Likes

#11

Just want to say that this plugin rocked my socks…that is all.

Thanks for the plugin!

0 Likes

#12

You bring tears to my eyes ;D

Now all we need is an email plugin :smile: (catb.org/jargon/html/Z/Zawinskis-Law.html)

0 Likes

#13

Using the console-based vi in SublimePTY inside Sublime Text doesn’t work. Outrageous! :smiley:

Seriously, this thing is really awesome. Amazing job!

0 Likes

#14

Yo dawg, I heard you like editors, so we put a plugin in your editor so you use an editor inside your editor.

:smile:

Seriously though, the first thing I did was load up vi inside Sublime Text, and then giggled when it worked.

0 Likes

#15

Thanks for the kind words :smile: This thing is becoming more and more usable with each passing hour.

I’ve got some problems with forcing shell on OSX to behave the same as my Ubuntu box.
That’s why mc/vim/tmux are not working correctly on OSX right now.
If anyone knows how to force OSX bash into full TERM=linux compatibility I’ll be glad to hear from them :smile:

http://i.imgur.com/x2R31.png
Problem? :mrgreen:
Yup, that’s Sublime -> PTY -> Bash -> tmux -> 4x bash [mc | ipython | apline | emacs] :smile:
And yes, you can kill sublime and “tmux attach” will work after restarting.

Oh, we are all so predictable ;D I did the same thing when it worked for the first time.

Lets not get too excited :smile: This is mostly just gluing together bits and pieces of existing software.

0 Likes

#16

So I thought to myself, I really want the Terminal to open in the current directory by default. “How hard could that be?” So I opened up the source code and my eyes glazed over in confusion, haha. It would be AMAZING if the terminal could be set to open with a vertical split like a console window, but I’m getting way ahead of myself.

BTW, I get VIM working fine. Not sure why that would be necessary but w/e.

0 Likes

#17

It would be AMAZING if the terminal could be set to open with a vertical split like a console window

You know wuub works with GIS system? 2 dimensional network layouts or something epic sounding.

I’ve need him to help me with splits.

0 Likes

#18

@castles, I was going to say ‘now if only castles pre-alpha released the grid splitting thinger we saw a screenshot of, we could get mini SublimePTY term windows’ :wink:

@wuub, thanks for posting ‘early and often’, it’s functional for me. The fancy still will come down the road, I hope (height adjustment, colors). The license bit confused me but a couple beers in order for sure. Cheers!

0 Likes

#19

@jtp2

Hint taken. Release early, release bla bla. I told wuub I wouldn’t mind releasing it to the general public if he helps me with support/maintenance. He’s busy with work and other stuff though I guess.

I’ve been waiting on Jon to take a look at the layout regrouping and batch view repositioning before really spending any further time on it. He said he won’t consider these until after 2.0 final is out. Most of the ideas I have for it depend on quick view positioning.

0 Likes

#20

Don’t be mean. It’s 40K of **dense **code and workarounds on workarounds, for the love of FSM :mrgreen:
It’s really difficult to wrap my head around it after full day of work. And after several reads I’m starting to think you overestimated my abilities :smile:

0 Likes