I want to write a 2D chess program.
It does not require much user input so it will use only the Windows Console, not any GUI.
I know how to access the Windows Console API and change its font using Assembly language or C++.
Using the same method for Windows Terminal does not work as it is written to behave as font agnostic terminal.
However, in Windows Terminal you can set the font to your liking through the settings.
I want to change the Windows Terminal font from the outside, before or during when Windows Terminal launches.
I know all Windows Terminal settings are stored in a JSON file so I can manipulate it before lanching.
I'm looking for a more straight forward approach like a command line option or a WINAPI call.
I could not find any.
Is there any way to programmaticaly change the Windows Terminal font?
Have a look at SetCurrentConsoleFontEx()
Sets extended information about the current console font.
I'm using 20 identical simulators (text base GUI like vi, refreshed quickly), and I need to control them in very similar way. e.g. input some command string to start/stop/config the simulator. The display is important, and I need them to flow on the terminal. Currently I can automatically start each one in a separate terminal.
But after that, I have no idea how to control them automatically. If I spawn the simulator using expect without a terminal, I will not be able to watch the output. Any suggestion on how could I proceed, or what tool could help?
This is tricky. You might be able to send the exact escape sequences which are generated by your keystrokes to your curses based program and then drive it. I don't know how reliable or easy that will be.
Would it not be possible to create an alternate front end which is scriptable for your simulator and use that for automated tasks like this rather than the CUI interface which is meant for human interaction?
There is an exe in system32 called edit.com . It is an old text editor. I'm wondering how they made a console app have a gui, and work with the mouse? Thanks
There are no shortcuts.The mouse had to be interfaced with through assembly code.You would call interrupt 33 to have access to several functions like reading the mouse motion counters and button states. Then you'd read the CPU registers to get those numbers. From there on you could do everything else in C, including the GUI-like interface. There's no shortcut to that either - it must be manually done, each individual square has to be painted the correct color.
edit.com is REALLY old. It was written before the Windows GUI was really popular. They probably use special DOS functions to create the graphics and recognize the mouse.
Well prior to Windows 3.1 there used to be an operating system call DOS and I believe the mouse thing came with DOS 5.0 or DOS 4.0.
Your best bet for adding mouse and color support to a console is to use some kind of TextArea control and make your own console instead of using the DOS console. You could also look into ncurses for Windows but I don't recommend it. If you just want color you could also look at this tutorial.
I read the following code in Unix Power Tools on page 117
*VT100.Translations: #override\
Button1 <Btn3Down>: select-end(primary,CUT_BUFFER0,CLIPBOARD)\n\
!Shift <Btn2Up>: insert-selection(CLIPBOARD)\n\
~Shift ~Ctrl ~Meta <Btn2Up>: insert-selection(primary,CUT_BUFFER0)
I have not managed to see any effect of the above code.
How can you use X clipboard in Screen, without your mouse?
Using the mouse. Left-click drag to select and usually the middle mouse button pastes but some terminals may differ (PuTTY uses right-click). If you only have two buttons you click them both together (left mouse button + right mouse button).
In reply to comment below ("Can you do it without your mouse?"):
ctrl-insert : copy
shift-insert : paste
shift-delete : cut
shift-ctrl-C : copy
shift-ctrl-V : paste
Not all applications will support the last three (though Konsole does). In fact most console applications will not allow you to delete text once it's printed.
As far as selecting text without a mouse I'm not sure there's a generic mechanism for that. It's probably terminal and/or application specific (ie, vim has it's own keys for marking and copying text - but only within vim). You could do it with mouse emulation but I'm sure that would be a painful process.
You can't use the traditional Mac/Windows shortcuts in a terminal because they were reserved for different actions long before these OS existed (ie, Ctrl-C terminates the running process).
I'm trying to use Ctrl-C in X
X does not handle these operations directly, they are handled by the application. That's why modern GUI programs like Firefox or Gedit support Ctrl-C for copy but terminals and command-line programs generally do not. As I said, it's a conflict in established conventions and Ctrl-C for kill got in first.
BTW, you could do some key-remapping if it drives you nuts but then you would be learning bad habits when you use a different machine. Best to just get used to it or do most of your editing in a GUI application.
More Information
EDIT: For a Mac, this may help: MacOSX-to-Konsole or This or This. It looks like you need to replace Ctrl with Command on Mac keyboards. It seems like Terminal the mac console has a right-click context menu for copy-paste so to do it the traditional way you me need to install a different console program or change some settings in Terminal.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
Locked. This question and its answers are locked because the question is off-topic but has historical significance. It is not currently accepting new answers or interactions.
I find working on the command line in Windows frustrating, primarily because the console window is wretched to use compared to terminal applications on linux and OS X such as "rxvt", "xterm", or "Terminal". Major complaints:
No standard copy/paste. You have to turn on "mark" mode and it's only available from a multi-level popup triggered by the (small) left hand corner button. Then copy and paste need to be invoked from the same menu
You can't arbitrarily resize the window by dragging, you need to set a preference (back to the multi-level popup) each time you want to resize a window
You can only make the window so big before horizontal scroll bars enter the picture. Horizontal scroll bars suck.
With the cmd.exe shell, you can't navigate to folders with \\netpath notation (UNC?), you need to map a network drive. This sucks when working on multiple machines that are going to have different drives mapped
Are there any tricks or applications, (paid or otherwise), that address these issue?
Sorry for the self-promotion, I'm the author of another Console Emulator, not mentioned here.
ConEmu is opensource console emulator with tabs, which represents multiple consoles and simple GUI applications as one customizable GUI window.
Initially, the program was designed to work with Far Manager (my favorite shell replacement - file and archive management, command history and completion, powerful editor). But ConEmu can be used with any other console application or simple GUI tools (like PuTTY for example). ConEmu is a live project, open to suggestions.
A brief excerpt from the long list of options:
Latest versions of ConEmu may set up itself as default terminal for Windows
Use any font installed in the system, or copied to a folder of the program (ttf, otf, fon, bdf)
Run selected tabs as Administrator (Vista+) or as selected user
Windows 7 Jump lists and Progress on taskbar
Integration with DosBox (useful in 64bit systems to run DOS applications)
Smooth resize, maximized and fullscreen window modes
Scrollbar initially hidden, may be revealed by mouseover or checkbox in settings
Optional settings (e.g. pallette) for selected applications
User friendly text and block selection (from keyboard or mouse), copy, paste, text search in console
ANSI X3.64 and Xterm 256 color
Far Manager users will acquire shell style drag-n-drop, thumbnails and tiles in panles, tabs for editors and viewers, true colors and font styles (italic/bold/underline).
PS. Far Manager supports UNC paths (\\server\share\...)
Try Console 2.
Console is a Windows console window enhancement. Console features include: multiple tabs, text editor-like text selection, different background types, alpha and color-key transparency, configurable font, different window styles
Take Command. This one has been around for a long time (formerly 4DOS). I used this on Windows NT 3.5 (!) and loved it.
Cygwin lets you run X on Windows, so you can fire up xterm or whatever terminal app you prefer, and also get the benefit of using a UNIX shell.
Turn on quickedit mode (but selection is still rectangular instead of line-wrapped)
Resizing by dragging works for me
You can change the buffer size which will impact when scrollbars appear
pushd \\server\share
Even with those, cmd.exe isn't a great console. See all the other replies and the earlier stackoverflow questions on the same subject. The "Console" project from sourceforge looks pretty good.
Console
From documentation:
NOTE: Console is NOT a shell.
Therefore, it does not implement shell
features like command-line completion,
syntax coloring, command history, etc.
Console is simply a nice-looking front
end for a shell of your choice
(cmd.exe, 4NT, bash, etc.) Other
command-line utilities can also be
used as 'shells' by Console.
As a programming shell one can use ipython.
I've had these issues too for years on Windows, but I recently found this project:
Console
It still requires "mark mode" for copy/paste, but at least it's available from a right-click contextual menu (so you don't need to move the mouse to the top left and then move it again to the text you want to select)
UNC paths are not supported by cmd.exe but they are supported by PowerShell.
(Console can be configured to use any shell, including cmd.exe and PowerShell)
I use Cygwin inside the Poderosa terminal emulator.
I personally use Mintty. Therefore I use Cygwin (because thats the only shell it supports, as far as I know).
BTW There is another question: better command for Windows? I found.
I think you will love PowerCMD which you can work 4 command windows at the same time. Also, you can use many extra commands inside the PowerCMD.
PowerCMD
There is a small program mo.exe on github that solves the first three issues:
https://github.com/boolship/Mo
It runs in normal DOS console window, Git Bash on Windows, etc.
update:
That link is now deprecated, use: https://github.com/boolship/MoDi
Use Gow.exe ..
This will make your DOS-Prompt as Linux terminal...
else
Use ZOC.exe...its Trial-period terminal...
else
Install Git .. it gives a bash-console from where u can use unix commands, partially
I'm using Terminals for remote connection via Telnet, RDC, SSH, ...
Combines most used protocolls in one program.
URL: http://www.codeplex.com/Terminals
Why not use Putty?
I use rxvt from cygwin. It behaves very much like an xterm.
Take a look at Take Command.
Take Command is a comprehensive interactive GUI and command line environment that makes using the Windows command prompt and creating batch files easy and far more powerful.
(Take Command is, however, "not free".)