Sublime Forum

Shell-mode

#1

Sorry for yet another n00b question, but can I run a shell in a Sublime window? Couldn’t find the answer to this anyplace else.

0 Likes

#2

Shell Turtlestein plugin

Alternatively, there are two teminal plugins that essentially activate the external OS terminal program.

0 Likes

#3

I don’t think Shell Turtlestein is what I’m looking for. That just executes a single command, or launches the Terminal program for me (not much help).

Emacs (fwiw) has a shell in its own buffer, so you never have to leave emacs and–most importantly–you have all the same editing abilities in your shell that you do in your editor.

0 Likes

#4

There is no terminal built into ST, although SublimePTY was an attempt at that. From my experience, launching the OS terminal is usually the best solution since it is a full-fledged terminal program, and the conventions and shortcuts vary between operating systems.

0 Likes

#5

Being able to use the same search, movement, editing, etc., features in my shell is very useful. Mac OS Terminal doesn’t emulate Sublime, nor does csh.

Maybe I’ll hack it together someday, if my time ever frees up. Highly unlikely, though… :cry:

0 Likes

#6

You should look at github.com/wuub/sublimepty and talk to wuub before trying to accomplish having a terminal in Sublime Text. From what I understand, it is no trivial task, and there are limitations of the current ST API that prevent it from really working.

If you don’t want a full terminal, but just want to be able to type commands and see the output, Xiki (github.com/lunixbochs/SublimeXiki might be worth checking out.

0 Likes

#7

Yeah, PTY was quite fun experiment but it’s basically a one big hack on another big hack powered by a third hack :wink:. Forcing sublime to do things it was never meant to do:

There were three main problems:

  1. pushing changes on screen was a tiny bit too slow for it to be usable, it “worked” in tech-demo kind of way, but after a few minutes you would just get frustrated with it
  2. I was torn between developing windows version (for my day to day work) and linux/osx one (for my hobby projects).
  3. Sublime added ugly pinkish border around regions, making final output not really that pleasant to look at.

Since then 3 and 2 have changed somewhat. My new workplace is 100% POSIX compatible :wink: and Jon improved region drawing a bit. Also new async API in ST3 could make it easier to fix point 1.

I’ll probably try to revive this project soon and see what happens.

0 Likes

#8

Great! In the meantime I discovered the userecho page and +1’d the second-highest requested feature (although, by my reckoning, the code-folding one is basically done).

Thanks! Great user communities make great programs.

0 Likes