views:

4590

answers:

12

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)?

+6  A: 

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).

A: 

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

rlb.usa
+12  A: 

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

debugme
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.
Anders Sandvig
A: 

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).

JesperE
There is a rxvt-unicode package in the Cygwin repository, but it requires an X server, which I would prefer to avoid.
Anders Sandvig
A: 

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.

anon
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.
Anders Sandvig
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).
Anders Sandvig
+3  A: 

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

Thanks, that solved the input problem, but output is still wrong (? instead of non-ASCII characters).
Anders Sandvig
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.)
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?
Anders Sandvig
MinTTY does UTF-8. (You have to activate it in the codepage setting.) xterm and rxvt-unicode do it too.
+2  A: 

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

Dan Vinton
+1  A: 

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

Dan Dyer
+4  A: 

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
Mattias Kihlström
A: 

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
spoulson
A: 

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.

AFIRAN
+1  A: 

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.

Matt