KyleL
KyleL

Reputation: 1445

Is there a way to display a vertical arrow character in a linux terminal using ncurses?

I'm trying to reproduce an old GUI screen in my application that uses ncurses for terminal display. The old GUI used characters that looked like this: Up and Down Arrows

Is there a special ASCII code or other mechanism to do this with ncurses?

Upvotes: 0

Views: 2601

Answers (3)

parkydr
parkydr

Reputation: 7784

There are the alternate character set characters ACS_UARROW and ACS_DARROW, which you can display with addch and related functions, but what character they display depends on your terminal type.

Upvotes: 2

choroba
choroba

Reputation: 241858

If your terminal is unicode aware, your font can display unicode and your locale is set to unicode, you should be able to simply

echo '↑ or ↓'

Upvotes: 1

Atropo
Atropo

Reputation: 12531

You can use the arrows in unicode, here you can find a list of unicode arrows and the relative codes.

ncursesw has the support to wide character set, you should just set the locale:

setlocale(LC_ALL, "")

Upvotes: 1

Related Questions