Home Download Buy Blog Forum Support

SublimePTY [pre-alpha]

Re: SublimePTY [pre-alpha]

Postby duncan on Mon Feb 20, 2012 11:27 am

Thank you wuub.

Excellent work!
duncan
 
Posts: 17
Joined: Sat Aug 27, 2011 12:59 pm

Re: SublimePTY [pre-alpha]

Postby sublimator on Mon Feb 20, 2012 12:07 pm

>>> Don't be mean

Sorry, I didn't really `mean` anything by it :) Just we'd talked about it, but you've simply got other stuff like SublimePTY and work.

>>> I'm starting to think you overestimated my abilities :)

Puhlease! You aint getting out that easy! hahaha
It is better to remain silent and be thought a fool, than to speak out and remove all doubt
sublimator
 
Posts: 649
Joined: Thu Mar 20, 2008 5:41 am

Re: SublimePTY [pre-alpha]

Postby Grant on Tue Feb 21, 2012 12:45 pm

Will any MinGW or Cygwin help with getting this supported in Windows?

Edit - Forget I asked, i found the library

Why doesn't this work on Windows? the Pyte library should be cross platform
Grant
 
Posts: 68
Joined: Fri Jan 20, 2012 2:42 pm

Re: SublimePTY [pre-alpha]

Postby wuub on Tue Feb 21, 2012 1:59 pm

Grant wrote:Will any MinGW or Cygwin help with getting this supported in Windows?
Why doesn't this work on Windows? the Pyte library should be cross platform


Pyte is not a problem. Actually w/o it this whole thing would probably never happen!

I want SublimePTY to be real terminal emulator/console on all three platforms. The main reason behind that, is that if you don't emulate terminal good enough, some programs behave differently.

Doing this on osx and linux is mostly the same and well documented (http://blog.nelhage.com/2009/12/a-brief ... o-termios/) that's why I am working on it first and with good results.

Attaching and controlling a windows console is a different thing altogether. One Example: a single windows process can have only ONE console attached, so if you want to control many, you need to spawn child processes and because they need to detach from parent console and create a new one for themselves, you can't communicate with them through STDIO (AFAIK). So, you have to communicate through something else, Conque uses shared memory (actually, 4 shared memory blocks per subprocess) but it's a mess. I would love to use 0MQ, but unfortunately it crashes sublime, so it's either bare sockets or something like Pyro4.

I'll probably take a look if bash.exe ran in the way SublimeREPL does it is usable as a POSIX/VT100 compatible shell. But it's a workaround and ultimately I would like to avoid that.
SublimeREPL via Package Control & SublimePTY dev/pre-alpha. Donations are appreciated, but not required :) Twitter: @wuub
wuub
 
Posts: 218
Joined: Wed Aug 10, 2011 8:16 am
Location: Poland

Re: SublimePTY [pre-alpha]

Postby num on Thu Feb 23, 2012 9:19 pm

Amazing stuff wuub. Great find on leveraging the pyte library.

I had fun trying to capture ansi escape codes from /bin/bash and attempt to output the proper color combo from a custom theme using view.add_region(). I ran into a brick wall with border around the regions and quickly found out that you already attempted to do exactly this right from the get-go: http://www.sublimetext.com/forum/viewtopic.php?f=5&t=2964&start=30#p22223 Needless to say this was a face-palm moment. I upvoted the http://sublimetext.userecho.com/topic/93643-/ for sure.

Would be great to set the pyte.Screen sizes as per the view size relative to the view.line_height() and view.em_width(). Maybe attach to the on_modified to maybe capture a view resize?

Would it be possible to have this work in an editable output panel ala get_output_panel()? Visually I think it would look better than another normal view.

Whenever the view gets focus via on_activated always set the cursor on the prompt. Maybe force a few other config options off like line highlighting as well.

Otherwise I'm floored how well this works - ipython and most shell commands I use on a regular basis (tab completion, history, ctrl+r, emacs bindings, etc).
num
 
Posts: 1
Joined: Thu Feb 23, 2012 8:45 pm

Re: SublimePTY [pre-alpha]

Postby wuub on Thu Feb 23, 2012 10:04 pm

I ran into a brick wall with border around the regions and quickly found out that you already attempted to do exactly this

Right now it's the only way to go if you want custom colors, but we (you and I) are not so smart! Go see this - on-the-fly theme generation for #rrggbb css highlight. It's insane! :D On the other hand, my 484.945 kb .sublime-keymap is a bit bananas as well :>


Thanks. Although I doubt Jon will add it :| .

Would be great to set the pyte.Screen sizes as per the view size relative to the view.line_height() and view.em_width(). Maybe attach to the on_modified to maybe capture a view resize?

99% it'll be ready on Monday. Most of the code is already in from day 1 (click1, click2 an click3). I just need to tie it all together.

Would it be possible to have this work in an editable output pane

I don't know. Underneath SublimePTY is a bit like screen/tmux - you'll be able to have more than one view attached to a process Attaching a output panel and trying it out should not be very difficult.

Whenever the view gets focus via on_activated always set the cursor on the prompt.

(todo: look into VT mouse codes, ...)
SublimeREPL via Package Control & SublimePTY dev/pre-alpha. Donations are appreciated, but not required :) Twitter: @wuub
wuub
 
Posts: 218
Joined: Wed Aug 10, 2011 8:16 am
Location: Poland

Re: SublimePTY [pre-alpha]

Postby C0D312 on Fri Feb 24, 2012 12:06 am

Hmmm thinking ahead, this could allow for interactive build systems. If we could somehow send it commands via keyboard shortcuts. :)

So much potential...

NOW GET BACK TO WORK!
C0D312
 
Posts: 1063
Joined: Sun Jul 10, 2011 3:23 am

Re: SublimePTY [pre-alpha]

Postby wuub on Sat Feb 25, 2012 4:47 pm

how to force OSX bash into full TERM=linux compatibility


If anyone wondered, it had nothing to do with OSX bash and everything to do with the fact, that ST2 on OSX uses python that still is has this problem: http://bugs.python.org/issue4978 It was silently failing underneath, after removing some try blocks it finally surfaced.

SublimePTY's pyte is now fixed and everything seems to be working correctly!
Total time wasted: +- 4h
Total changes required to fix: 6 bytes
Word per minute: 0.1257 :mrgreen:
SublimeREPL via Package Control & SublimePTY dev/pre-alpha. Donations are appreciated, but not required :) Twitter: @wuub
wuub
 
Posts: 218
Joined: Wed Aug 10, 2011 8:16 am
Location: Poland

Re: SublimePTY [pre-alpha]

Postby francois on Thu Apr 12, 2012 6:43 am

Hi all,

Thanks to share this great plugin to the community ! It's a "must have" for me. Thank you very much ;)

I'm using Sublime Text 2 Build 2181 with SublimePTY v0.06 and I've got a few question on it's behavior:

* only the upper half of the screen is used: the shell prompt is always at the half height of the buffer. Is it the normal behavior ?
* it looks like it doesn't' support colors in its output like with a 'ls --color'
* all Sublime key bindings are disabled when in a PTY. How can we access Sublime key bindings ?

Thank you very much and have a nice day
Cheers

Francois
francois
 
Posts: 5
Joined: Mon Apr 02, 2012 8:13 am

Re: SublimePTY [pre-alpha]

Postby wuub on Thu Apr 12, 2012 9:06 am

As you can probably see, I didn't have time to touch any of my plugins in over 2 months now. They are not abandoned though, i'm just super busy @work for several more weeks.

* only the upper half of the screen is used: the shell prompt is always at the half height of the buffer. Is it the normal behavior ?


My plan is to have SublimePTY automatically resize terminal to the full available area. It's number one entry on the TODO but still not there.
Right now ROW/COLS are hardcoded here: https://github.com/wuub/SublimePTY/blob/master/process.py#L31. Feel free to adjust it for now.

* it looks like it doesn't' support colors in its output like with a 'ls --color'


It did (sort of) at pre^(n)-alpha stage http://userecho.com/FYWX But without a way to get rid of those cell borders colored output was more distracting than helpful.

* all Sublime key bindings are disabled when in a PTY. How can we access Sublime key bindings ?


Unfortunately yes. And for a reason. I am sending all keystrokes to the process running inside terminal, so they don't get to the ST2. At some point in the future I would like to find a better solution or at least have an "escape" sequence (think ctrl+alt in VMWare) but that's further down the line.
SublimeREPL via Package Control & SublimePTY dev/pre-alpha. Donations are appreciated, but not required :) Twitter: @wuub
wuub
 
Posts: 218
Joined: Wed Aug 10, 2011 8:16 am
Location: Poland

PreviousNext

Return to Plugin Announcements

Who is online

Users browsing this forum: Google [Bot] and 7 guests