Programming a terminal emulator, what's in it?
Asked Answered
V

9

3

This is related somewhat to this question about a better shell terminal/gui-interface for cmd.exe

In my quest to find a better shell terminal, the only useful thing I came across was Console2, other alternatives weren't free and generally didn't offer much more than Console2 to make them worth their price.

I can't help but wonder, "how come"? The shell terminal is a very valuable tool to a programmer, yet no one came around to try and do a better job than cmd.exe (except for the guys @ console2)??

Surely designing a command line shell terminal emulator can't be such a hard task!

Has anyone tried writing a shell terminal emulator before? What's in it? Any resources out there (say, if I want to program my own shell)?

UPDATE

17/07/2009

I rephrased the question, what I was referring to as a "shell" is actually called a terminal emulator (at least in the linux world). I only realized this recently so I thought I should revisit this question and fix it.

Verticillate answered 11/2, 2009 at 2:41 Comment(3)
Ah, I see. You want to continue using the cmd.exe 'shell' but change change the 'window' that wraps around it. While I think that's a good idea (cut'n'paste is a pain), I've never seen anything that can do this.Borras
actually, console2 (which I linked to) does it, but it doesn't quite satisfy me ..Verticillate
console2 is OSS... So you could try to improve it. To me it seems that way console2 is using hidden "cmd.exe"s is doomed to be buggy.Sympathizer
B
5

There are plenty of shells around for Windows, bash under Cygwin is the one I use the most, and it's certainly free. I have to be honest here, cmd.exe has come a long way since the batch file processor of MSDOS. It's actually quite powerful, but still not a pimple on the rear end of bash :-).

You should try to write a command line shell, it will be an education for you. It's not that hard to do the basics if all you want is a program launcher.

But, if you want all the power of a real shell, including a full blown programming language, job control, piping, output redirection and (seriously) too many other things to list, we probably won't be hearing from you for a while. Except when you pop up your head to ask us esoteric questions about how shells should do this or that.

Borras answered 11/2, 2009 at 2:51 Comment(1)
Thanks for response, I updated my question. As for what you describe as "the power of a real shell", I think I'll stick to python :)Verticillate
H
5

What about PowerShell from Microsoft? AFAIK it's free, and gives you C# power right in the shell, and tons of other features. But, it DOES require the NET Framework...

I won't endorse it yet, as I haven't really used it, but it's on my list to do...

Homesick answered 11/2, 2009 at 2:59 Comment(5)
Powershell is at least as expressive as the classic *nix shells, and rather more extensible imo. It's a powerful tool that I'm making a point of learning for my more script-oriented problems. :)Fonville
He is looking for a wrapper around cmd.exe... If you open up the PowerShell console you still get cmd.exe running PowerShell with a nice blue background.Sympathizer
It seems everyone bitches about the cut and paste in cmd... I don't get it. I've been using it since early 95 in the Win95 betas and stuff. I've never stopped. But, I DO force all my shells into 'Quick Edit' by default, and a 'mode 80,50', with 3000 lines of scroll back...Homesick
'Quick Edit' mode is really great. It gives you Putty-like copy-paste. | Left click+drag=>select+copy | Right click=>pasteSympathizer
I know.. I don't have a problem using it, but others seem to... No, it does not select text by LINE, but rather by BLOCK, but it's easy enough to get used to, and use.Homesick
U
3

My bets are on Powershell for the future if you are a Windows guy.

PowerShell will be installed by default on Windows Server 08 R2 (WS08R2) and Windows 7 according to MS.

I have used Powershell myself and found it to be very useful, and if you are familiar with .NET then its all the more easier.

Download a two page reference document here, this is all you will need to get started.

Undergrown answered 11/2, 2009 at 5:58 Comment(1)
He is looking for a wrapper around cmd.exe... If you open up the PowerShell console you still get cmd.exe running PowerShell with a nice blue background.Sympathizer
U
2

I mean the gui-interface part that displays the text,

Ah! you mean what we call a "pseudo-tty" or a "terminal emulator" in unix. In windows, I guess it is called a "console host". I do not use windows, but I heard that console2 is very good. Seems there are others:

and, of course, for real programmers, you have the shell mode of (x)emacs :-)

Unguentum answered 13/2, 2009 at 20:36 Comment(0)
P
1

Erm... what about all the ports of Unix command shells to Windows?

Perzan answered 11/2, 2009 at 2:43 Comment(0)
E
1

Just go with cygwin and log on using PuTTY. So much better than the standard console. :)

Excurrent answered 13/2, 2009 at 20:42 Comment(0)
A
0

Also, Python (or perl for that matter) can replace the shell entirely.

Arrival answered 11/2, 2009 at 3:8 Comment(3)
Really, do you want to be running your programs with 'system("excel.exe")'? I know perl/python are good for programming but they don't have job control or very good launch capabilities, do they?Borras
I think he's referring to admin tasks, and the like.Verticillate
@Pax: Python has all the job control and launch capabilities that the OS has, which is sometimes more than what the shell has. Look at the Python subprocess module, for example.Arrival
C
0

You might want to try Take Command Console, formerly 4NT, formerly 4DOS.

Quick summary of points you might care about:

  • Command line editing with filename completion, history, and cut & paste
  • Integrate PERL, Ruby, REXX, Python, and any Active Scripting language
  • Fast - 20-200% faster output display than the standard Windows console
  • Integrated file explorer - examine directories, drag and drop files
  • Upwardly compatible with CMD.EXE with literally thousands of additions

Not free (except trial version) and not open source. I haven't tried it myself, but I was a 4DOS junkie back in the day, before Cygwin.

Certificate answered 27/3, 2009 at 1:44 Comment(0)
W
0

If you need handy terminal - give a try to ConEmu (I'm the author). It is a Windows console window enhancement (local terminal emulator), which presents multiple consoles and simple GUI applications as one customizable tabbed GUI window with dozens of features.

Another answer and comments

Wasp answered 27/11, 2012 at 7:20 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.