Term2, Terminal in Atom (Fork of Term)


#1

Hello all!

There was an awesome Term package in Atom Package directory, but it was unstable and the developer doesn’t care :confused:

So I forked the package and created another package called Term2. It wasn’t CoffeeScript and I rewrite it using CoffeeScript. Also fixed to run Vim, Emacs in it.

This is the package:

Thanks!


Access system shell through Atom?
#2

Not sure I see the improvement here. I tried both, and while the first seems to works with some glitch (mostly due to term.js limitation), yours doesn’t display anything.

I don’t have the choice to open the terminal in the same pane, it forces me to create a new split, and I have nothing displayed in that created pane. And there’s no error in the console.

Did I missed something here ?


#3

This is the first feedback that it’s not working.

Do you have any errors on developer console?


#4

I just added a feature to create new terminal as new tab ctrl + alt + t. But it clears the pane contents. Trying to figure out.


#5

Yep, that’it, just reinstalled it and removed all other packages and I still can see the pane appearing then disappearing instantly.
If it can help you, I just put a bit of log in destroy and this is the stack leading to the view destruction:

in destroy: 
  at TermView.destroy (/Users/cedric/.atom/packages/term2/lib/TermView.coffee:93:31)
  at Terminal.end (/Users/cedric/.atom/packages/term2/lib/TermView.coffee:41:20)
  at ReadStream.onend (_stream_readable.js:499:10)
  at ReadStream.g (events.js:190:16)
  at ReadStream.EventEmitter.emit (events.js:123:20)
  at _stream_readable.js:896:16
  at process._tickCallback (node.js:605:11)

#6

@abe what shell are you using? I had the same behavior with the pane appearing then disappearing instantly.

In my case, the problem was that I was using zsh rather than bash, and zsh doesn’t support the --init-file command which this plugin uses by default.

I created an issue: https://github.com/webBoxio/atom-term2/issues/2


#7

@darinmorrison I’m using zsh as well, nice find!


#8

Yes! I just upgraded version to work with Zsh :slight_smile:

webBoxio/atom-term2 @ b8dc8e31ddebd980329924e6bbee863410f7ae5c

That’s possibly why it doesn’t work.


#9

@fka :+1: nice, it works well now.

On another topic, I was wondering whose package was responsible for retrieving the terminal colors ?

I see that all colors are affected in a style attribute:

<div style="background-color:#4e9a06; color:#2e3436;">

But the values aren’t those of my current terminal settings. Is there a way to make it uses my system settings ?
I also think it would be better if instead we could have classes so that the terminal theme could be defined through the user stylesheet directly in Atom. Maybe it could be leaved as an option available through the package settings, what do you think?


#10

Yeah, looks good, but nukes some key commands,

cmd-W to close the tab is killed, similarly keyboard navigating tabs isn’t possible either from the terminal tab.

This is particularly annoying for me as my theme gets rid of the tab UI so its a bit of a fiddle to kill the tab.

edit: oh, so I can get cmd-W to work but only if I focus on a different tab and then focus back again, any other actions then kills the keymaps. This is sort-of ok with a split pane but would probably be pretty awkward with a single pane view.


#11

Yes term.js makes this. I’ll try to make it cleaner and bind the terminal colors into Atom as you mentioned. I think term.js has option doing this. Going to dig it.


#12

Yes, term.js handles all the key bindings to itself, so you have to focus another window to take them back.


#13

It also prevents 3rd level characters such as ~ which can also be quite annoying in a terminal (see https://github.com/chjj/term.js/pull/5). All this seems like a lot of work for me.
How do you see dealing with these keyboard issues? Making a PR in term.js? Forking it?
Seeing how a real terminal pane was one of the features asked the more repetitively in sublime user echo I guess this could be a real selling point for Atom.


#14

@abe I released new minor version, you can now customize colors in settings of Term2 :smile:


#15

So, good work on continuing to update and add features, however, I have a small (well, ok, large) issue for you, I’ll also open it in the repo.


Atom CPU usage before opening term2


Atom CPU usage with term2 open.

So I thought it might be an issue in that I was running a watch task in there (standard grunt watch task, nothing fancy), so I tried just opening term2:


CPU usage immediately after opening term2 into a new right pane.


Also tried just opening up a different pane without term2 in there to make sure Atom wasnt playing silly buggers, no problems, its deffo term2.

edit Oh, I should add this is with OSX 10.8.5 on a non-retina MBP.


#16

Same CPU issue here. alt-ctrl-t, shell tab opens, one helper takes up one core full blast.
Until now, I had not experienced this kind of issue before trying Term2.
I hope this can be fixed somehow.


#18

Same high CPU usage with Term2 here!