Sublime Forum

SublimePTY [pre-alpha]

#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

#21

Thank you wuub.

Excellent work!

0 Likes

#22

Donā€™t be mean

Sorry, I didnā€™t really mean anything by it :smile: 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 :smile:

Puhlease! You aint getting out that easy! hahaha

0 Likes

#23

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

0 Likes

#24

[quote=ā€œGrantā€]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[/quote]

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 (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.

0 Likes

#25

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: https://forum.sublimetext.com/t/automatic-backup-plugin/32/1#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).

0 Likes

#26

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! :smiley: On the other hand, my 484.945 kb .sublime-keymap is a bit bananas as well :>

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

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.

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.

(todo: look into VT mouse codes, ā€¦)

0 Likes

#27

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

So much potentialā€¦

NOW GET BACK TO WORK!

0 Likes

#28

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: 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:

0 Likes

#29

Hi all,

Thanks to share this great plugin to the community ! Itā€™s a ā€œmust haveā€ for me. Thank you very much :wink:

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

0 Likes