编写 Mac OS X 终端仿真器?
我想为 Mac OS X 创建一个终端模拟器。问题是:我不知道从哪里开始。我可以只使用一大堆 NSTasks 吗?或者我是否必须阅读 xterm、urxvt 等程序的大量源代码? 我不需要太多的可定制性(=没有配置文件解析),也不需要复杂的功能,我只会使用 bash 作为 shell。
感谢您的解答!
-麦克风
I'd like to create a terminal emulator for Mac OS X. The problem is: I have no idea where to start. Can I just use a whole bunch of NSTasks? Or do I have to read through tons of source code for programs like xterm, urxvt, etc?
I don't want a lot of customizability (= no config file parsing), nor complex features, and I'm only gonna use bash as the shell.
Thanks for answers!
-Mike
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我会查看 Visor:http://code.google.com/p/blacktree-visor / 这是一个雷神之锤风格的终端,可以从屏幕边缘上下滑动。
iTerm (http://iterm.sourceforge.net/) 也是一个值得关注的好项目(也许甚至比 Visor 还要好)。
I'd check out Visor: http://code.google.com/p/blacktree-visor/ It's a Quake-style terminal that slides up and down from the edge of the screen.
iTerm (http://iterm.sourceforge.net/) would also be a good project to look at (perhaps even better than Visor).
正如 Dave 所说,iTerm 可能是最好的起点。
对于其他人来说,xterm/urxvt 可能不是最容易阅读的内容,因为它们将在 VT100 和 Xlib 之间进行映射,这是一种低级别的映射。一个可能更容易阅读的实现是 VTE 终端,GNOME使用,因为它将在 VT100 和 GLib/GTK+ 之间进行映射,这可能更接近 Mac OS X 提供的功能。
祝你好运!
As Dave said, iTerm is probably the best place to start.
As for others, xterm/urxvt might not be the easiest thing to read for this, since they'll be mapping between VT100 and Xlib, which is kind of low-level. An implementation that might be easier to read is VTE terminal, which GNOME uses, since it'll be mapping between VT100 and GLib/GTK+, which is probably a lot closer to what Mac OS X provides.
Good luck!