Forum: Ruby Ruby curses: “Real” borders?

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
85991f138ede6236f35eb98da22b7b01?d=identicon&s=25 Marvin Gülker (quintus)
on 2013-09-05 15:46
(Received via mailing list)
Hi there,

I’m just trying to get started with the curses library in Ruby’s
standard library. I wanted to draw a window using the “real” unicode
characters for this, i.e. ─ for horizontal and │ for vertical lines
(UTF-8 being pretty standard now, using - and | is not an option). So I
tried the obvious (the following is a self-contained example):

# -*- coding: utf-8 -*-
require "curses"

include Curses


  str = "Hello world ☺"

  win =, cols, 0, 0)"─", "│")"-", "|")
  win.setpos( lines / 2, (cols / 2) - (str.chars.count / 2) )
  win.addstr str


This presents me a window with a border of blinking reverse-video “â”
characters instead of the expected continuous lines. Interestingly, the
unicode smiley (☺) in #addstr is displayed correctly, so I doubt it’s a
problem with curses itself.

So: How do I get continuous lines for window borders with curses?

This topic is locked and can not be replied to.