Best terminal environment for Cygwin/Windows?
Asked Answered
F

21

53

Today I run Cygwin with rxvt using the following startup line:

rxvt -bg black -sl 8192 -fg white -sr -g 150x56 -fn "Fixedsys" -e /usr/bin/bash --login -i

This gives me a resizeable native Windows window which is much better than the standard "DOS box" the default cygwin.bat provides.

However, the current configuration does have a couple of issues:

  1. I am not able to enter non-ASCII characters into the terminal window (i.e. æ, ø, å and Æ, Ø, Å, which I use semi-frequently. In fact, the terminal will not even accept them when I paste them into the window. If I paste a string like "bølle" (Norwegian for "bulley"), all I get is "blle".
  2. I am not able to render UTF-8 character, they only show as ?, even if they are supported by the font (i.e. when rendering the same characters in ISO-8859-1 they show just fine.).

I am running English Windows Vista with locale and keyboard layout set to Norwegian (ISO-8859-1 character set?), but I've had the exact same issue on Windows 2000 and XP.

Anyone knows how to fix this (i.e. a better way to configure rxvt)?

Apart from the issues mentioned above, I'm very happy with rxvt, so if I find a way to resolve them I'd like to continue using it. However, if the issues are not (easily) solvable, are the any other good terminal solutions for Cygwin?

Update

The solution provided by Andy and Mattias (editing the .inputrc file) did solve the input problem, but output rendering is still an issue. Output is fine when I render in ISO-8859-1, but when using UTF-8 I only get ? for non-ASCII characters. This behavior is consistent between rxvt, urxvt (under Cygwin XFree X Server), mintty and PuttyCyg.

Is there a similar configuration file where output encoding can be set (i.e. the equivalent of setting output locale on a Linux system)?

Fag answered 31/3, 2009 at 16:28 Comment(0)
H
10

Add the following two lines to the readline config file ~/.inputrc

set convert-meta off
set output-meta on

Should work both in rxvt and mintty. More here:

http://www.gnu.org/software/bash/manual/bashref.html#Readline-Init-File-Syntax

Haeres answered 1/4, 2009 at 11:7 Comment(4)
Thanks, that solved the input problem, but output is still wrong (? instead of non-ASCII characters).Fag
Output from 'echo' or 'cat' should be fine. Editing in vi or nano should be fine too. But I guess you mean e.g. output from ls, where filenames come out with question marks? I'm afraid I don't know how to fix that . (Cygwin 1.7 has some Unicode support; I guess that'll help.)Haeres
Actually, I'm thinking about programs I know output to stdout in utf-8 (i.e. the ones I write myself). Maybe it's because Cygwin doesn't really support utf-8, yet?Fag
MinTTY does UTF-8. (You have to activate it in the codepage setting.) xterm and rxvt-unicode do it too.Haeres
A
37

minTTY is also pretty good. You can find it in cygwin's setup. Supports re-sizing, pasting, and transparency.

Aurita answered 31/3, 2009 at 16:41 Comment(4)
mintty seems to have the exact same problems as rxvt, which makes me suspect it has something to do with Cygwin or the way the programs are started (i.e. not setting correct locale or encoding in the environment) and not the programs in themselves.Fag
mintty fixed this for me, even without the .inputrc changes mentioned. Running Windows 7 x64. Thanks for mentioning mintty - hadn't heard of it before and it seems great so far.Pneumatophore
I switched from rxvt to mintty and it solved several problems. It was long enough ago that I don't recall all of them but UTF-8 was one.Fungous
Native Windows interactive console programs do not work with mintty as of 1.2-beta1 (specifically, its streams aren't detected as a tty with isatty).Monoxide
E
12

I'm currently using PuttyCyg (http://code.google.com/p/puttycyg/). I'm not sure if it will contain fixes needed by you, but it has several other cool features, for example configurations stored to typical putty profiles, which can be invoked like: putty -load mycygwin1. Such profile can configure things like:

  • logging sessions to a file,
  • character sequences for delete, home, and other keys,
  • window colors and fonts.

Edit: it is possible to enter chars you mentioned. UTF-8 support is also provided (it has to be turned on in configuration).

Emoryemote answered 31/3, 2009 at 16:34 Comment(2)
+1 for PuTTYCyg. Useful if you already regularly connect to remote machines with PuTTY anyway.Vesical
For a full list of instructions on how to PuttyCyg into your Cygwin as well as relevant notes and configuration files see the effective-cygwin GitHub page.Qualification
H
10

Add the following two lines to the readline config file ~/.inputrc

set convert-meta off
set output-meta on

Should work both in rxvt and mintty. More here:

http://www.gnu.org/software/bash/manual/bashref.html#Readline-Init-File-Syntax

Haeres answered 1/4, 2009 at 11:7 Comment(4)
Thanks, that solved the input problem, but output is still wrong (? instead of non-ASCII characters).Fag
Output from 'echo' or 'cat' should be fine. Editing in vi or nano should be fine too. But I guess you mean e.g. output from ls, where filenames come out with question marks? I'm afraid I don't know how to fix that . (Cygwin 1.7 has some Unicode support; I guess that'll help.)Haeres
Actually, I'm thinking about programs I know output to stdout in utf-8 (i.e. the ones I write myself). Maybe it's because Cygwin doesn't really support utf-8, yet?Fag
MinTTY does UTF-8. (You have to activate it in the codepage setting.) xterm and rxvt-unicode do it too.Haeres
I
9

Being four years old, at the time of writing, the meat of the question has gone off: the default Cygwin terminal now accepts pasting of, and renders, non-Ascii characters without formality, at least for me. Cygwin's default terminal is now mintty and Cygwin now operates with UTF-8 by default. (For example, /etc/profile.d/lang.sh now sets a UTF-8 character set encoding by default.) There's now a 64 bit version of Cygwin but, per http://www.cygwin.com/ml/cygwin/2013-09/msg00029.html, no 64 bit port of rxvt.

Even the question in the title is less vital than once it was, as mintty doesn't grate like the old Windows command console subsystem windows. Still, I'll plug the project I co-maintain: https://github.com/software-jessies-org/jessies/wiki/Terminator, which was written for UTF-8, possibly from day one, though its main selling point, imo, is the Find feature.

Insecticide answered 23/9, 2013 at 3:33 Comment(0)
E
8

I'm using Console as well. Console allows you to customize font, background, etcetera and also has a tabbed interface (great if you use more than one terminal window at once).

In order to be able to use non-ASCII characters I have put the following in my .inputrc file in my home directory:

set meta-flag on
set convert-meta off
set output-meta on
set completion-ignore-case on
Evasion answered 1/4, 2009 at 11:32 Comment(0)
W
3

You may need to set the codepage.

Check your current :

$ set | grep CYGWIN
CYGWIN='codepage:oem nodosfilewarning'

If you have not the codepage, then add to your ~/.bashrc file:

CYGWIN='codepage:oem nodosfilewarning'

The contents of my Cygwin batch (Cygwin.bat) file, started by a shortcut, are:

start C:\cygwin\bin\rxvt.exe -sb -sl 3000 -fg gray -bg black -fn "Lucida Console-14" -e /bin/bash --login -i

Note that for the CYGWIN environ variable you can have multiple items, each seperated by a space. Other items that can be used: { tty binmode title }.

More info can be read here: http://www.cygwin.com/cygwin-ug-net/setup-env.html

A related note: you can also use mrxvt for Cygwin. It requires an X server, and a nice solid/lightweight solution is to use Xming. I compiled mrxvt and installed it - not really hard to do, and it works great.

I use rxvt as an initial window, then launch mrxvt as a seperate process from rxvt by using an alias command, then close rxvt. This makes mrxvt its own parent process, and has no cmd sessions attached.

I made an alias to do this:

alias mrx='export DISPLAY="127.0.0.1:0.0"; $(/usr/local/bin/mrxvt &); echo -e "\033c"'

For ease I created a batch file to start Xming and rxvt:

@echo off
start C:\cygwin\bin\rxvt.exe -sb -sl 3000 -fg gray -bg black -fn "Lucida Console-14" -e /bin/bash --login -i
start C:\Xming\Xming.exe :0 -clipboard -multiwindow -trayicon
exit

This batch file is launched by a windows shortcut. This has worked well for me.

Welterweight answered 28/5, 2010 at 8:48 Comment(0)
W
2

I've been using Console which works pretty well with Cygwin (as well as PowerShell and plain old cmd.exe).

Wildwood answered 1/4, 2009 at 11:16 Comment(0)
A
2

When I was developing on Windows I found Poderosa to be a good choice for Cygwin.

Animalism answered 1/4, 2009 at 11:21 Comment(0)
Z
1

Standard Cygwin/X with xterm is good enough for me. Install the Cygwin X.org package, then run the script C:\cygwin\bin\startxwin.bat (assuming default install path). It'll start X and then xterm.

I updated my .Xdefaults with these options for better usability:

*VT100*scrollbar.width:         14
*VT100*scrollbar.background:    gray60
*VT100*scrollbar.foreground:    rgb:a/5/5
*VT100*scrollbar.borderWidth:   0
*VT100*scrollbar.displayList:\
foreground      gray90;\
lines           1,-1,-1,-1,-1,1;\
foreground      gray60;\
lines           -1,1,1,1,1,-1
*VT100*rightScrollBar: true
*VT100*scrollBar: true
*VT100*scrollLines: 1000
xterm*toolBar: false
Zebec answered 1/4, 2009 at 13:17 Comment(0)
R
1

If you use ls with certain arg it is showing file names OK I suggest you put an ls alias in /etc/profile:

alias ls='ls -F --color=auto --show-control-chars'

Works for me in msys on a WinXP.

Recommendatory answered 21/1, 2010 at 7:12 Comment(0)
E
1

I would set up your country in windows (Control Panel -> Regional Settings -> Last Tab (control) -> Language for unicode-uncompatible languages -> Your choice (Norwegian)). After reboot start Start->Cyqwin->rxvt-native. For russian it works (without editing .bashrc or whatever).

It even (as I guess) converts the output of the soft into utf-8, because the default encoding is C.UTF-8. To check it type "echo $LANG".

Edmea answered 8/11, 2010 at 10:9 Comment(0)
R
1

On the topic of alternative terminal emulators for cygwin - check out Console2; it has all the features you'll need.

Reckford answered 4/10, 2011 at 10:12 Comment(0)
E
1

rxvt is incapable of unicode, so you can not make it work correctly if you log into machines that use UTF-8 for encoding. You can use rxvt for iso-8859-1/15, but most machines now are UTF-8.

The unicode replacement for rxvt in Cygwin is urxvt, the package name under Cygwin is rxvt-unicode-X. urxvt also has other nice features, such as many downloadable plugins - including one that gives you multiple tabs per window, and a client/server architecture that makes it use a lot less resources if you have many windows (urxvtc/urxvtd).

You may also need to make sure your readline variables specify that your shell should pass through 8-bit characters, i.e. add this to your $HOME/.bashrc or $HOME/.profile:

set convert-meta off
set output-meta on
set input-meta on

You will have to set the right resources in $HOME/.Xdefaults: in particular you will need a font that has the characters you want. The resource group name for urxvt is URxvt. Note the capitalization, it matters!

URxvt.font: xft:Lucida Console:size=8:style=normal:weight=50:antialias=true:hinting=true:minspace=true
URxvt.boldFont: xft:Lucida Console:size=8:style=bold:weight=100:antialias=true:hinting=true:minspace=true

I also recommend setting:

URxvt*termName: xterm

This resource decides the value of the $TERM environment variable. Unless it is correctly set, the right termcap file can not be found, causing programs like less to emit warnings in the style of: WARNING: terminal is not fully functional. Unfortunately, the default termName of rxvt-unicode isn't known under many Linux distributions, so if you often ssh to remote machines, you will run into the problem. The solution is to either set termName to something more common (like xterm), or upload a termcap-file for rxvt-unicode to all the servers you log into.

Emmalynne answered 28/6, 2013 at 13:12 Comment(3)
where can we get urxvt from? It doesn't seem to be available from the cygwin installer.Prestidigitation
It's available under the packages rxvt-unicode-X and rxvt-unicode-common.Emmalynne
The update of the question is commenting that even under urxvt, they still get '?' for UTF-8 characters. One important point is to use a font that actually has the characters needed, but the resource name under .Xdefaults is a bit picky: It is an error to use the resource name: "Urxvt.*" The correct resource name is: "URxvt.*" The difference is only in capitalization, and it eluded me for quite a while before I figured it out.Emmalynne
D
1

Since the title is somehow misleading, and search results brought me here many times, I'll just answer reading the title.

I like using Babun on Windows as Cygwin Environment, it's almost perfect for me.

Derickderide answered 1/4, 2016 at 12:55 Comment(0)
D
1

Please try ConEmu which is an opensource console emulator with tabs, which represents multiple consoles and simple GUI applications as one customizable GUI window.

https://conemu.github.io/

Diapophysis answered 12/5, 2017 at 6:58 Comment(0)
J
1

xfce4-terminal (available from Cygwin setup.exe) is the best for me because it looks great (easy to read) and if started with XLaunch (also available from setup.exe), I can start other cygwin GUI applications from it. For some reason, I can't launch GUI applications from mintty. I found this thread looking for a less ugly terminal than xterm (which works fine for launching GUI applications). In the end, I found the best one (xfce4-terminal) just by searching on terminal in setup.exe. xfce4-terminal has been one of my favorites on Linux for more than 7 years now.

Guake is also available in setup.exe, but I have to launch it from another terminal and click that other terminal before using keystrokes to bring down Guake. So, that's not so practical as it is on Linux.

Josselyn answered 31/3, 2018 at 1:17 Comment(0)
M
0

On a similar note to emg-2, Lifehacker recently had an article about MinTTY, not sure if it contains fixes needed by you.

Mariquilla answered 31/3, 2009 at 16:40 Comment(0)
G
0

If you're content with only running Cygwin-applications, then rxvt should work fine. Rxvt should have UTF-8 support. Did you try googling for a solution?

If you also need to run native Windows applications, you're out of luck unless you run bash inside the Windows console. There are two issues which I don't believe are (or even can be) solved:

  • Ctrl-C doesn't work properly. If you run a native windows application from inside rxvt (or xterm), pressing Ctrl-C will give you back a prompt, but it does not interrupt the program, often leaving it to run in the background.
  • Terminal output buffering doesn't work. Output from native windows applications aren't displayed as they are printed, but rather when some internal buffer is full.

These two issues are the same with all the terminal emulators I've tried (rxvt, xterm, Emacs, and a few others).

Gabie answered 31/3, 2009 at 16:46 Comment(1)
There is a rxvt-unicode package in the Cygwin repository, but it requires an X server, which I would prefer to avoid.Fag
E
0

Apart from the complete resizability, what features does rxvt gice you that a Windows console window doesn't? And have you looked at the difference in memory usage - rxvt is a hog. I use rxvt for a couple of weeks and the switched back to a windows console window, without regrets.

Emoryemote answered 31/3, 2009 at 16:51 Comment(4)
rxvt (and, apparently, mintty) give me colors in the terminal when logging into a remote ssh session (via openssh), running bash.exe as a "DOS program" does not. Also I like the ability to copy past simply marking it and pasting text using the mouse wheel or middle mouse button.Fag
In general, terminal emulation (via ssh) works better in a "real" terminal instead of just using bash.exe (If I remember correctly, the bash.exe method also has problems with certain shortcut keys and character sequences when working with remote sessions).Fag
The console just sucks in regards to copy-n-paste. "real" terminals don't need to right-click, select copy and hit return just to copy stuff. Biggest problem in the console. Also affects powershell which makes it painful to use.Resurgent
"Apart from the complete resizability" is sort of like "other than that, Mrs Lincoln, how was the play?"Philology
C
0

yes, mintty seems more comfortable, light and fast, but there is one feature it doesn't have, and the default (windows) console have, that is the search function: from the default console, you can search string displayed on the console, fun ?

up to now, i haven't found any other console have this feature... i you know, tell me, i really don't like the default console.

Carew answered 23/12, 2012 at 5:20 Comment(0)
C
0

I have used several terminals such as putty, console, rxvt, mintty, teraterm. the best is the teraterm. it is free, fully compatible for lang and tty, fully configurable with macro, shortcut, and give the cygterm for Cygwin.

however if you light user, just use mintty which is default term these day or rxvt.

Cutthroat answered 5/12, 2013 at 13:39 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.