Giter VIP home page Giter VIP logo

curses's Introduction

curses

Gem Version ubuntu windows macos

Description

A Ruby binding for curses, ncurses, and PDCurses. curses is an extension library for text UI applications.

Formerly part of the Ruby standard library, curses was removed and placed in this gem with the release of Ruby 2.1.0. (see ruby/ruby@9c5b2fd)

Install

$ gem install curses

Requires ncurses or ncursesw (with wide character support). On Debian based distributions, you can install it with apt:

$ apt install libncurses5-dev

Or

$ apt install libncursesw5-dev

On Windows, gem install curses will build bundled PDCurses, so you don't need to install extra libraries. However, if you prefer ncurses to PDCurses, specify the following option:

> gem install curses -- --use-system-libraries

On mingw, you need DevKit to compile the extension library.

On MacOS, ncurses menu isn't natively supported. You can install the gem with menu support using homebrew:

brew install ncurses
gem install curses -- --use-system-libraries --with-ncurses-dir=/usr/local/opt/ncurses

with /usr/local/opt/ncurses the path where homebrew installed ncurses on your machine

Documentation

See https://www.rubydoc.info/gems/curses.

Developers

After checking out the repo, run bundle install to install dependencies.

To compile the extension library, run bundle exec rake compile.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in curses.gemspec, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

License

curses is released under the Ruby and 2-clause BSD licenses. See COPYING for details.

It includes a forked version of PDCurses, which is in the public domain:

https://github.com/Bill-Gray/PDCurses

The version for Win32 console mode in the wincon subdirectory is used.

curses's People

Contributors

alexb52 avatar amatsuda avatar atshakil avatar binford2k avatar chrisarcand avatar coezbek avatar dependabot[bot] avatar divinedominion avatar drbrain avatar dvarrui avatar hsbt avatar isty001 avatar mcormier avatar meschbach avatar nobu avatar peter50216 avatar qume avatar shugo avatar stomar avatar tiredpixel avatar unak avatar znz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

curses's Issues

Curses 1.3.1 not installing with Ruby <=2.4.4 on Ubuntu 19.04

When running gem install curses on Ubuntu 19.04 building the native extension for curses v1.3.1 fails for Ruby versions <=2.4.4. libncursesw5-dev and libncurses5-dev are installed. I tried with C-Ruby versions installed via RVM.

Because the failure logs are about 4900 lines long, I’ll attach them as a file:
curses-1.3.1.zip

Installing the gem works for me for Ruby >=2.4.5.

Can't exit curses program and retain screen contents

Hi!

Please try the following program:

#!/usr/bin/ruby

require 'curses'
include Curses

init_screen
crmode

setpos((lines - 5) / 2, (cols - 10) / 2)
addstr('Hit any key')
refresh

getch

# Don't close_screen(); we want the screen contents to remain after
# exiting

Expected result:

  • After you hit some key, the program should quit and the "Hit any key" message should still be visible on screen

Current result:

  • When the program exits, the screen contents is restored to what it was before the program was started

Note:

  • If you kill -9 the program, it exits without restoring the screen contents just like I want, but then it exits with a non-zero return code.

The use case is that I want my pager implementation to be able to exit without restoring screen contents when pressing ^C:
https://github.com/walles/moar

I currently use the kill -9 workaround, but would like to be able to do without it.

Regards /Johan

Note that this issue is cloned from https://bugs.ruby-lang.org/issues/9177 upon request from Hiroshi SHIBATA.

Misleading installation instructions for Windows in readme.md

I noticed that on Windows the curses gem can be currently installed with just gem install curses.
Why is this not clearly written in the readme?

I was under the impression that a binary was not available for windows so I lost a lot of time looking for other ways to install it!

It should be more clear that on Windows all you have to do is "gem install curses".

sample/color.rb error

I'm using OpenSUSE 15.2 OS. And I'm running ruby 3.0,3 installed over rbenv and ruby 2.5.0 on real machine.
I had run all samples on my laptop without problems but when I run sample/colors.rb I get this error:

ruby colors.rb
colors.rb:14:in colors': colors() function is unimplemented on this machine (NotImplementedError) from colors.rb:14:in

'

Could you give me any suggestion to fix it? Thanks!

Pass ansi color codes straight through to a curses window?

Is there a way to output text to a curses window without curses messing with the ansi color codes - I would like the color codes to simply pass through and let the text be colored in the window. I am perfectly aware of how to color text in curses, but I would rather not go through that roundabout when outputting syntax highlighted text to a curses window (like with the command

curses_window << `batcat --color=always #{file}`

... where batcat is the syntax highlighting cousin to cat (also known as just "bat")

Does not compile and cannot be installed on macOS (Apple Silicon)

Trying to install the gem as per documentation. Tried Rubies 3.3, 3.2, 3.1.

$ gem install curses -- --use-system-libraries --with-ncurses-dir=/opt/homebrew/opt/ncurses
Fetching curses-1.4.4.gem
Building native extensions with: '--use-system-libraries --with-ncurses-dir=/opt/homebrew/opt/ncurses'
This could take a while...
ERROR:  Error installing curses:
	ERROR: Failed to build gem native extension.

    current directory: /Users/piotr/.gem/ruby/3.1.3/gems/curses-1.4.4/ext/curses
/Users/piotr/.rubies/ruby-3.1.3/bin/ruby -I /Users/piotr/.rubies/ruby-3.1.3/lib/ruby/3.1.0 extconf.rb --use-system-libraries --with-ncurses-dir\=/opt/homebrew/opt/ncurses
checking for tgetent() in -ltinfow... no
checking for tgetent() in -ltinfo... no
checking for tgetent() in -ltermcap... yes
checking for ncursesw/curses.h... yes
checking for initscr() in -lncursesw... yes
header: ncursesw/curses.h
library: ncursesw
checking for beep()... yes
checking for bkgd()... yes
checking for bkgdset()... yes
checking for curs_set()... yes
checking for deleteln()... yes
checking for doupdate()... yes
checking for flash()... yes
checking for getbkgd()... yes
checking for getnstr()... yes
checking for init()... no
checking for init in ncursesw/curses.h... no
checking for isendwin()... yes
checking for keyname()... yes
checking for keypad()... yes
checking for resizeterm()... yes
checking for scrl()... yes
checking for set()... no
checking for set in ncursesw/curses.h... no
checking for setscrreg()... yes
checking for ungetch()... yes
checking for addnwstr()... yes
checking for wattroff()... yes
checking for wattron()... yes
checking for wattrset()... yes
checking for wbkgd()... yes
checking for wbkgdset()... yes
checking for wdeleteln()... yes
checking for wgetnstr()... yes
checking for wresize()... yes
checking for wscrl()... yes
checking for wsetscrreg()... yes
checking for werase()... yes
checking for redrawwin()... yes
checking for waddnwstr()... yes
checking for mvderwin()... yes
checking for derwin()... yes
checking for touchwin()... yes
checking for untouchwin()... yes
checking for wtouchln()... yes
checking for is_linetouched()... yes
checking for is_wintouched()... yes
checking for def_prog_mode()... yes
checking for reset_prog_mode()... yes
checking for timeout()... yes
checking for wtimeout()... yes
checking for nodelay()... yes
checking for init_color()... yes
checking for wcolor_set()... yes
checking for use_default_colors()... yes
checking for assume_default_colors()... yes
checking for newpad()... yes
checking for unget_wch()... yes
checking for get_wch()... yes
checking for wget_wch()... yes
checking for PDC_get_key_modifiers()... no
checking for PDC_get_key_modifiers in ncursesw/curses.h... no
checking for convertible type of chtype... unsigned int
checking for _XOPEN_SOURCE_EXTENDED... yes
checking for ESCDELAY in ncursesw/curses.h... yes
checking for TABSIZE in ncursesw/curses.h... yes
checking for COLORS in ncursesw/curses.h... yes
checking for COLOR_PAIRS in ncursesw/curses.h... yes
checking for function curses_version in ncursesw/curses.h... yes
checking for variable curses_version in ncursesw/curses.h... no
checking for ncursesw/menu.h... yes
checking for new_menu() in -lmenuw... yes
checking for ncursesw/form.h... yes
checking for new_form() in -lformw... yes
checking for form_driver_w()... yes
checking for sizeof(WINDOW) is available... yes
checking for sizeof(MEVENT) is available... yes
checking for sizeof(ITEM) is available... yes
checking for sizeof(MENU) is available... yes
checking for sizeof(FIELD) is available... yes
checking for sizeof(FORM) is available... yes
creating extconf.h
creating Makefile

current directory: /Users/piotr/.gem/ruby/3.1.3/gems/curses-1.4.4/ext/curses
make DESTDIR\= sitearchdir\=./.gem.20240313-99458-tl51wo sitelibdir\=./.gem.20240313-99458-tl51wo clean

current directory: /Users/piotr/.gem/ruby/3.1.3/gems/curses-1.4.4/ext/curses
make DESTDIR\= sitearchdir\=./.gem.20240313-99458-tl51wo sitelibdir\=./.gem.20240313-99458-tl51wo
compiling curses.c
curses.c:3072:1: warning: function 'no_item' could be declared with attribute 'noreturn' [-Wmissing-noreturn]
{
^
curses.c:3270:1: warning: function 'no_menu' could be declared with attribute 'noreturn' [-Wmissing-noreturn]
{
^
curses.c:5103:5: error: incompatible function pointer types passing 'VALUE (VALUE, VALUE)' (aka 'unsigned long (unsigned long, unsigned long)') to parameter of type 'VALUE (*)(VALUE)' (aka 'unsigned long (*)(unsigned long)') [-Wincompatible-function-pointer-types]
    rb_define_method(cItem, "opts", item_opts_m, 0);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/piotr/.rubies/ruby-3.1.3/include/ruby-3.1.0/ruby/internal/anyargs.h:287:135: note: expanded from macro 'rb_define_method'
#define rb_define_method(klass, mid, func, arity)           RBIMPL_ANYARGS_DISPATCH_rb_define_method((arity), (func))((klass), (mid), (func), (arity))
                                                                                                                                      ^~~~~~
/Users/piotr/.rubies/ruby-3.1.3/include/ruby-3.1.0/ruby/internal/anyargs.h:276:1: note: passing argument to parameter here
RBIMPL_ANYARGS_DECL(rb_define_method, VALUE, const char *)
^
/Users/piotr/.rubies/ruby-3.1.3/include/ruby-3.1.0/ruby/internal/anyargs.h:254:72: note: expanded from macro 'RBIMPL_ANYARGS_DECL'
RBIMPL_ANYARGS_ATTRSET(sym) static void sym ## _00(__VA_ARGS__, VALUE(*)(VALUE), int); \
                                                                       ^
curses.c:5124:5: error: incompatible function pointer types passing 'VALUE (VALUE, VALUE)' (aka 'unsigned long (unsigned long, unsigned long)') to parameter of type 'VALUE (*)(VALUE)' (aka 'unsigned long (*)(unsigned long)') [-Wincompatible-function-pointer-types]
    rb_define_method(cMenu, "fore", menu_get_fore, 0);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/piotr/.rubies/ruby-3.1.3/include/ruby-3.1.0/ruby/internal/anyargs.h:287:135: note: expanded from macro 'rb_define_method'
#define rb_define_method(klass, mid, func, arity)           RBIMPL_ANYARGS_DISPATCH_rb_define_method((arity), (func))((klass), (mid), (func), (arity))
                                                                                                                                      ^~~~~~
/Users/piotr/.rubies/ruby-3.1.3/include/ruby-3.1.0/ruby/internal/anyargs.h:276:1: note: passing argument to parameter here
RBIMPL_ANYARGS_DECL(rb_define_method, VALUE, const char *)
^
/Users/piotr/.rubies/ruby-3.1.3/include/ruby-3.1.0/ruby/internal/anyargs.h:254:72: note: expanded from macro 'RBIMPL_ANYARGS_DECL'
RBIMPL_ANYARGS_ATTRSET(sym) static void sym ## _00(__VA_ARGS__, VALUE(*)(VALUE), int); \
                                                                       ^
curses.c:5126:5: error: incompatible function pointer types passing 'VALUE (VALUE, VALUE)' (aka 'unsigned long (unsigned long, unsigned long)') to parameter of type 'VALUE (*)(VALUE)' (aka 'unsigned long (*)(unsigned long)') [-Wincompatible-function-pointer-types]
    rb_define_method(cMenu, "back", menu_get_back, 0);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/piotr/.rubies/ruby-3.1.3/include/ruby-3.1.0/ruby/internal/anyargs.h:287:135: note: expanded from macro 'rb_define_method'
#define rb_define_method(klass, mid, func, arity)           RBIMPL_ANYARGS_DISPATCH_rb_define_method((arity), (func))((klass), (mid), (func), (arity))
                                                                                                                                      ^~~~~~
/Users/piotr/.rubies/ruby-3.1.3/include/ruby-3.1.0/ruby/internal/anyargs.h:276:1: note: passing argument to parameter here
RBIMPL_ANYARGS_DECL(rb_define_method, VALUE, const char *)
^
/Users/piotr/.rubies/ruby-3.1.3/include/ruby-3.1.0/ruby/internal/anyargs.h:254:72: note: expanded from macro 'RBIMPL_ANYARGS_DECL'
RBIMPL_ANYARGS_ATTRSET(sym) static void sym ## _00(__VA_ARGS__, VALUE(*)(VALUE), int); \
                                                                       ^
curses.c:5130:5: error: incompatible function pointer types passing 'VALUE (VALUE, VALUE)' (aka 'unsigned long (unsigned long, unsigned long)') to parameter of type 'VALUE (*)(VALUE)' (aka 'unsigned long (*)(unsigned long)') [-Wincompatible-function-pointer-types]
    rb_define_method(cMenu, "opts", menu_opts_m, 0);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/piotr/.rubies/ruby-3.1.3/include/ruby-3.1.0/ruby/internal/anyargs.h:287:135: note: expanded from macro 'rb_define_method'
#define rb_define_method(klass, mid, func, arity)           RBIMPL_ANYARGS_DISPATCH_rb_define_method((arity), (func))((klass), (mid), (func), (arity))
                                                                                                                                      ^~~~~~
/Users/piotr/.rubies/ruby-3.1.3/include/ruby-3.1.0/ruby/internal/anyargs.h:276:1: note: passing argument to parameter here
RBIMPL_ANYARGS_DECL(rb_define_method, VALUE, const char *)
^
/Users/piotr/.rubies/ruby-3.1.3/include/ruby-3.1.0/ruby/internal/anyargs.h:254:72: note: expanded from macro 'RBIMPL_ANYARGS_DECL'
RBIMPL_ANYARGS_ATTRSET(sym) static void sym ## _00(__VA_ARGS__, VALUE(*)(VALUE), int); \
                                                                       ^
2 warnings and 4 errors generated.
make: *** [curses.o] Error 1

make failed, exit code 2

Gem files will remain installed in /Users/piotr/.gem/ruby/3.1.3/gems/curses-1.4.4 for inspection.
Results logged to /Users/piotr/.gem/ruby/3.1.3/extensions/arm64-darwin-22/3.1.0-static/curses-1.4.4/gem_make.out

Curses versus Ncurses confusion

I tried this:

gem install ncurses

The output was that:

"Fetching ncurses-0.9.1.gem
ERROR: Error installing ncurses:
#<Gem::Specification name=ncurses version=0.9.1> has an invalid specification_version
"

So first I thought this was the curses gem here, but I believe this is another gem.

Perhaps the main README could mention this? I was about to report the above but then
I realized that the name is "curses" rather than "ncurses". A bit confusing to me; I made
the incorrect assumption that ncurses would be curses and vice versa.

Not Displaying Wide Characters

Despite:

$ sudo apt install libncursesw5 libncursesw5-dev

window.box(' ', "\u2500")

outputs a horizontal block of gray text instead of a nice horizontal box line.

What steps are needed to display wide unicode characters using the curses gem?

I can confirm the version of ruby does properly output the unicode I expect:

 puts "\u2500"*9
─────────

NCURSES_EXT_COLORS - see python

https://bugs.python.org/issue36982

"A new function called curses.has_extended_color_support() will indicate whether the linked ncurses library provides extended color support. It returns true if curses.h defines NCURSES_EXT_COLORS and NCURSES_EXT_FUNCS, indicating that the extended color functions are available. This seems more useful to developers than using an indirect method like trying to set a color-pair greater than 0x7fff and checking for an exception to indicate lack of support."

Would this make sense to add for ruby too? E. g. a method such as:

Curses.has_extended_color_support?

I'd love to be able to use more than 8 colours via ncurses. In particular the html-colours:

https://htmlcolorcodes.com/colors/

I could then add this to my gem e. g.

CursesParadise.steelblue("Hello world!\n")

As easier alternative.

Newest curses fails to build on macOS Mojave, with ruby 2.6.2.

After a gem update, I'm suddenly seeing this build failure:

current directory: /opt/slangs/rb/mygems/gems/curses-1.3.0/ext/curses
make "DESTDIR="
compiling curses.c
curses.c:218:1: warning: function 'no_window' could be declared with attribute 'noreturn' [-Wmissing-noreturn]
{
^
curses.c:244:63: error: invalid application of 'sizeof' to an incomplete type 'WINDOW' (aka 'struct _win_st')
    if (winp->window && winp->window != stdscr) size += sizeof(*winp->window);
                                                              ^~~~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/curses.h:322:16: note: forward declaration of 'struct _win_st'
typedef struct _win_st WINDOW;
               ^
1 warning and 1 error generated.
make: *** [curses.o] Error 1

make failed, exit code 2

This is on macOS 10.14.4. with Xcode 10.2, and the operative ruby is version 2.6.2 that I built and installed myself. The previous versions of the curses gem built just fine.

gem installation warning: "Couldn't find file to include xyz"

I just installed the gem.

Response was:

Fetching curses-1.4.4.gem
Building native extensions. This could take a while...
Successfully installed curses-1.4.4
Parsing documentation for curses-1.4.4
Couldn't find file to include 'sample/hello.rb' from ext/curses/curses.c
Couldn't find file to include 'sample/rain.rb' from ext/curses/curses.c
Couldn't find file to include 'sample/mouse.rb' from ext/curses/curses.c
Installing ri documentation for curses-1.4.4
Done installing documentation for curses after 0 seconds
1 gem installed

The three warnings relate to some .rb file in sample - see lines starting
from 5-7.

Could these three .rb files be included? hello.rb rain.rb and mouse.rb. Not
sure why they could not be found.

Are some files missing on the .gem release?

So I just installed the curses-1.4.1 gem.

However had, in the sample/ directory I see the following 7 .rb files:

form.rb
hello.rb
menu.rb
mouse.rb
rain.rb
view2.rb
view.rb

On github, though, if you go here:

https://github.com/ruby/curses/tree/master/sample

You can see 11 files:

addch.rb
attr_demo.rb
colors.rb
form.rb
hello.rb
menu.rb
mouse.rb
mouse_move.rb
rain.rb
view.rb
view2.rb 

I am quite confused. Is the gem built from some other source target that explains why 4 files seem to be missing? Or is this some user error?

I am relearning curses (have had old code with Ncurses as toplevel module name) so I randomly looked at attr_demo.rb
first via the browser. Then I wanted a local copy to experiment, and just downloaded the gem, then noticed that some files are missing. Very strange..

Curses::addch doesn't support attributes

The documentation says that addch would support outputting characters with attributes, but in practice it doesn't work.

Ways to reproduce:

require "curses"
include Curses

init_screen
begin
  addstr("The following letter A should be BOLD and UNDERLINED by using addch:\n")
  addch('A'.ord | A_BOLD | A_UNDERLINE)

  addstr("\nIt should look the same as when using attron and addstr:\n")
  attron(A_BOLD | A_UNDERLINE)
  addstr("A")
  getch
ensure
  close_screen
end

What I am seeing:

image

Is just the documentation inaccurate or does the conversion from NUM2CH remove the attributes again?

addch(NUM2CH(ch));

segfault on `init_screen`

Hi,

I've been attempting to get curses working for ruby on my machine, but the first init_screen crashes everything.

stack trace:
log.txt

I've narrowed it down to libtinfo, and bringing in libtinfow.so fixes it.

Not working version:

$ ldd ~/.gem/ruby/2.4.0/gems/curses-1.3.1/lib/curse
	linux-vdso.so.1 (0x00007ffd47b59000)
	libruby24.so.2.4 => /usr/lib64/libruby24.so.2.4 (0x00007f736b160000)
	libformw.so.6 => /usr/lib64/libformw.so.6 (0x00007f736b14c000)
	libmenuw.so.6 => /usr/lib64/libmenuw.so.6 (0x00007f736b142000)
	libncursesw.so.6 => /lib64/libncursesw.so.6 (0x00007f736b108000)
	libtinfo.so.6 => /lib64/libtinfo.so.6 (0x00007f736b0cc000)
	libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f736b0aa000)
	libc.so.6 => /lib64/libc.so.6 (0x00007f736aed9000)
	libgmp.so.10 => /usr/lib64/libgmp.so.10 (0x00007f736ae60000)
	libdl.so.2 => /lib64/libdl.so.2 (0x00007f736ae5a000)
	libcrypt.so.1 => /lib64/libcrypt.so.1 (0x00007f736ae21000)
	libm.so.6 => /lib64/libm.so.6 (0x00007f736ace3000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f736b453000)
	libtinfow.so.6 => /lib64/libtinfow.so.6 (0x00007f736aca7000)

Notice how libtinfow is being pulled in, just after libtinfo

Here's the quick patch I made to get everything up and running:
tinfo.patch.gz

And the linked libraries after, works:

$ ldd ~/.gem/ruby/2.4.0/gems/curses-1.3.1/lib/curse
	linux-vdso.so.1 (0x00007ffe2554b000)
	libruby24.so.2.4 => /usr/lib64/libruby24.so.2.4 (0x00007f2ffaad9000)
	libformw.so.6 => /usr/lib64/libformw.so.6 (0x00007f2ffaac5000)
	libmenuw.so.6 => /usr/lib64/libmenuw.so.6 (0x00007f2ffaabb000)
	libncursesw.so.6 => /lib64/libncursesw.so.6 (0x00007f2ffaa81000)
	libtinfow.so.6 => /lib64/libtinfow.so.6 (0x00007f2ffaa45000)
	libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f2ffaa23000)
	libc.so.6 => /lib64/libc.so.6 (0x00007f2ffa852000)
	libgmp.so.10 => /usr/lib64/libgmp.so.10 (0x00007f2ffa7d9000)
	libdl.so.2 => /lib64/libdl.so.2 (0x00007f2ffa7d3000)
	libcrypt.so.1 => /lib64/libcrypt.so.1 (0x00007f2ffa79a000)
	libm.so.6 => /lib64/libm.so.6 (0x00007f2ffa65c000)

I suspect the cause of this is in part because of the distro I'm running, gentoo, which allows me to compile libraries in all sorts of wacky ways.

To aid with debugging, here's my install log for ncurses:
ncurses_install.log.gz

Support for chgat?

Is there any support for modifying attributes for characters already on the screen in Ruby curses? It seems that the chgat family of functions aren't supported. Since they are particularly helpful for rendering virtual cursors, I was wondering how this is solved in Ruby curses.

Compatibility with Ruby 2.7 on Windows

I tried to install Curses while using Ruby 2.7 on Windows, but it seems 2.7 is not allowed yet.

      curses (~> 1.3.2) x64-mingw32 was resolved to 1.3.2, which depends on
        Ruby (< 2.7.dev, >= 2.5) x64-mingw32

Could you please take a look at it if it's possible to change the requirement?

.box() doesn't work with UTF-8

Hi.

The .box() method does not work with UTF-8 characters.

window.box('│', '─') leads to displaying â character (it is grey rectangle in my terminal).

Where these dashes are box-drawing characters copied directly into the code (with unicode transcription it doesn't work either).

What works however is UTF-8, but with .addstr() method.

Curses 1.2.4
Ruby 2.4
Fedora 25

Curses.newterm is absent

I have been stuck using a very old library and unable to switch to this Curses library because of the absence of newterm. I do curses over telnet with multiple screens simultaneously so this method is critical for me.

Any chance you can add this, I'm at the point where I'm about to fork this project as the old library is crashing on me.

Easy install for Windows

I used Ruby 1.9 x86 with Windows. Now I installed 2.1 x64. I discovered that curses is not bundle anymore with Ruby and this gem is supposed to be the replacement. A quick gem install curses failed, because some native libraries needed to be built. I installed the dev-kit. It does not seem to include the required headers. I might be able to get the headers from cygwin by installing ``libncurses-devel`, but that is already quite a lot of effort already after installing the devkit.

Is there some way to have the gem include a prebuilt dll for Windows? For Python, it seems to be possible to offer packages with binaries for platforms to not require compiling the native libraries. As it currently stands, it is quite difficult to just get up and running if the devkit is not sufficient for compiling the gem.

It used to be really easy for a Windows user to use ncurses with Ruby since it was bundled with the Ruby install. The gem is not a sufficient replacement on Windows as a platform, if there are not easy instructions and an easy way to build to gem. On Linux it would be quite simple to obtain the missing headers and build the gem, but this is not the case for Windows.

Using / downloading Curses on ruby 2.3.0

I downloaded curses using "gem install curses", while using ruby 2.3.0 whenever i attempt to start a script in which i used curses i get "

C:/RailsInstaller/Ruby2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:5
5:in require': cannot load such file -- curses.so (LoadError) from C:/RailsInstaller/Ruby2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel _require.rb:55:in require'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/curses-1.2.3-x
86-mingw32/lib/curses.rb:17:in rescue in <top (required)>' from C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/curses-1.2.3-x 86-mingw32/lib/curses.rb:13:in <top (required)>'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel
_require.rb:127:in require' from C:/RailsInstaller/Ruby2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel _require.rb:127:in rescue in require'
from C:/RailsInstaller/Ruby2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel
_require.rb:40:in require' from test.rb:1:in

'
tried in 3 different computers, all 2.3.0 ruby version

uninitialized constant Curses::Menu (NameError)

Hi,

I've been trying the different sample code for curses. All of them work except for the sample/menu.rb
Running ruby sample/menu.rb gives me this error.

sample/menu.rb:13:in `<main>': uninitialized constant Curses::Menu (NameError)

menu = Curses::Menu.new([

I'm on mac OS ventura 13.4.1 and homebrew seems to have ncurses 6.4 already installed.

I can see that there are some issues getting menu from ncurses from MacOS

Is this why there is no documentation on the README for MacOS?

The menu sample works fine when inside the official docker image ruby:3.0

What would it take to get ncurses menu to work?

Thanks for your help

Curses.get_char fails on multibyte characters

I can't capture any of the multibyte characters (ie. function keys, arrow keys, and ESC) because they are all evaluating to the same thing: "\e".

Description of Curses.get_char: "Read and returns a character or function key from the window." (emphasis mine)

Single byte characters work fine, and escape code characters (\t for tab) work.

Using version 1.4.3
(I'd like to navigate through text buffers with directional keys)

Thank you for any insight or feedback in advance.

Handle screen size changes while calling getch

Attached is a simple curses program that displays some text and calls getch. It also sets up a trap on SIGWINCH so that it can detect window size changes.

require 'curses'
include Curses

@listeners = []

def size_changed
  # TODO -- notify all size changed listeners
  @listeners.each { |listener|
    #listener.screen_size_changed
 }
end


begin
  Signal.trap('SIGWINCH', size_changed )

  init_screen
  Curses.raw
  clear
  curs_set(0)
  noecho
  cbreak
  start_color

  Curses.stdscr.setpos(0, 0)
  Curses.stdscr.addstr("Press any key ")
  Curses.stdscr.getch

rescue SystemExit, Interrupt
  # Empty Catch block so ruby doesn't puke out
  # a stack trace when CTRL-C is used
ensure
  Curses.close_screen
end

The issue is that the call to an array method causes a NoMethodError when the size_changed method gets called.

To reproduce:

  1. Run the sample program
  2. Resize the terminal window

untitled

I also found this post:
http://masanjin.net/blog/ruby-ncurses-and-thread-blocking

That talks about some implementations of curses blocking threads on getch.

I took a look at the ncurses-ruby gem and found some interesting code in C, entitled rbncurshelper_nonblocking_wgetch

https://github.com/eclubb/ncurses-ruby/blob/master/ext/ncurses/ncurses_wrap.c#L792

Basically, I'm writing a GUI library on top of curses and would like to handle window resizes by notifying all objects to redraw themselves. Was wondering.

  1. Are there limitations to what you can do when handling a signal?
  2. Is getch blocking?
  3. Is there a better way to handle this then catching NoMethodError's like below
 def get_ch_handle_signals
      got_input = false
      while !got_input
        begin
          c = getch
          got_input = true
        rescue NoMethodError
          # TODO -- SIGWINCH could have occurred -- reposition..
          c = ''
        end
      end

      c
    end

Encoding issues

I'm, currently experiencing an issue with the "inch" method in Ruby curses, this is reproducible in both curses 1.4.2 and 1.4.1. However the issue is not present in curses 1.4.0

Using win.inch.chr returns the character at the cursor position as intended, but in curses 1.4.1/2 this results in an error saying char is out of range. Manually setting the encoding to UTF_8 or UTF_16 removes the error message but does not return the character as intended

ie
Curses 1.4.0 win.inch.chr expected behaviour
Curses 1.4.1+ win.inch.chr error, char out of range
Curses 1.4.1+ win.inch.chr(Encoding::UTF_8) returns ? block
Curses 1.4.1+ win.inch.chr(Encoding::UTF_16) interferes with formatting

Installation failure on Ruby 1.9.3-p484

I was wondering, is it intended that this gem work on Ruby 1.9.3-p484 ? I'm aware that it's an extraction of curses from the Ruby standard library (https://bugs.ruby-lang.org/issues/8584), being removed from Ruby 2.1.0 onwards, and that Ruby 1.9.3 already has curses included. On Ruby 2.0.0-p353 it installs fine for me, however, despite curses also being included in that standard library. The problem is with trying to use curses within a separate gem whilst supporting Ruby 1.9.3, 2.0.0, 2.1.0 for that gem. With the Ruby 1.9.3 gem install failure, I can't specify curses as a formal dependency within a gemspec—yet it's needed for the Ruby 2.1.0 support. I've got around it, but I'm interested to learn whether support for Ruby 1.9.3 is intended, and whether perhaps I've missed something. :)

I'm attempting to install on OS X 10.9.1 (13B42) with Xcode 5.0.2 (5A3005), RVM 1.25.14 (master), Gem 2.2.0, Bundler 1.5.1. On Ruby 2.1.0-p0 all seems well with curses gem installed, on Ruby 2.0.0-p353 gem installs without error, on Ruby 1.9.3-p484 I get the following:

$ gem install curses -V
HEAD https://rubygems.org/latest_specs.4.8.gz
302 Moved Temporarily
HEAD https://s3.amazonaws.com/production.s3.rubygems.org/latest_specs.4.8.gz
200 OK
GET https://rubygems.org/latest_specs.4.8.gz
302 Moved Temporarily
GET https://s3.amazonaws.com/production.s3.rubygems.org/latest_specs.4.8.gz
200 OK
HEAD https://rubygems.org/specs.4.8.gz
302 Moved Temporarily
HEAD https://s3.amazonaws.com/production.s3.rubygems.org/specs.4.8.gz
200 OK
GET https://rubygems.org/specs.4.8.gz
302 Moved Temporarily
GET https://s3.amazonaws.com/production.s3.rubygems.org/specs.4.8.gz
200 OK
/Users/mlnw/.rvm/gems/ruby-1.9.3-p484/gems/curses-1.0.0/BSDL
/Users/mlnw/.rvm/gems/ruby-1.9.3-p484/gems/curses-1.0.0/COPYING
/Users/mlnw/.rvm/gems/ruby-1.9.3-p484/gems/curses-1.0.0/History.md
/Users/mlnw/.rvm/gems/ruby-1.9.3-p484/gems/curses-1.0.0/Manifest.txt
/Users/mlnw/.rvm/gems/ruby-1.9.3-p484/gems/curses-1.0.0/README.md
/Users/mlnw/.rvm/gems/ruby-1.9.3-p484/gems/curses-1.0.0/Rakefile
/Users/mlnw/.rvm/gems/ruby-1.9.3-p484/gems/curses-1.0.0/curses.gemspec
/Users/mlnw/.rvm/gems/ruby-1.9.3-p484/gems/curses-1.0.0/ext/curses/curses.c
/Users/mlnw/.rvm/gems/ruby-1.9.3-p484/gems/curses-1.0.0/ext/curses/depend
/Users/mlnw/.rvm/gems/ruby-1.9.3-p484/gems/curses-1.0.0/ext/curses/extconf.rb
/Users/mlnw/.rvm/gems/ruby-1.9.3-p484/gems/curses-1.0.0/lib/curses.rb
/Users/mlnw/.rvm/gems/ruby-1.9.3-p484/gems/curses-1.0.0/sample/hello.rb
/Users/mlnw/.rvm/gems/ruby-1.9.3-p484/gems/curses-1.0.0/sample/mouse.rb
/Users/mlnw/.rvm/gems/ruby-1.9.3-p484/gems/curses-1.0.0/sample/rain.rb
/Users/mlnw/.rvm/gems/ruby-1.9.3-p484/gems/curses-1.0.0/sample/view.rb
/Users/mlnw/.rvm/gems/ruby-1.9.3-p484/gems/curses-1.0.0/sample/view2.rb
Building native extensions. This could take a while...
/Users/mlnw/.rvm/rubies/ruby-1.9.3-p484/bin/ruby extconf.rb
checking for tgetent() in -ltinfo... no
checking for tgetent() in -ltermcap... yes
checking for ncurses.h... yes
checking for initscr() in -lncursesw... no
checking for initscr() in -lncurses... yes
header: ncurses.h
library: ncurses
checking for beep()... yes
checking for bkgd()... yes
checking for bkgdset()... yes
checking for curs_set()... yes
checking for deleteln()... yes
checking for doupdate()... yes
checking for flash()... yes
checking for getbkgd()... yes
checking for getnstr()... yes
checking for init()... no
checking for init in ncurses.h... no
checking for isendwin()... yes
checking for keyname()... yes
checking for keypad()... yes
checking for resizeterm()... yes
checking for scrl()... yes
checking for set()... no
checking for set in ncurses.h... no
checking for setscrreg()... yes
checking for ungetch()... yes
checking for wattroff()... yes
checking for wattron()... yes
checking for wattrset()... yes
checking for wbkgd()... yes
checking for wbkgdset()... yes
checking for wdeleteln()... yes
checking for wgetnstr()... yes
checking for wresize()... yes
checking for wscrl()... yes
checking for wsetscrreg()... yes
checking for def_prog_mode()... yes
checking for reset_prog_mode()... yes
checking for timeout()... yes
checking for wtimeout()... yes
checking for nodelay()... yes
checking for init_color()... yes
checking for wcolor_set()... yes
checking for use_default_colors()... yes
checking for newpad()... yes
checking for ESCDELAY in ncurses.h... yes
checking for TABSIZE in ncurses.h... yes
checking for COLORS in ncurses.h... yes
checking for COLOR_PAIRS in ncurses.h... yes
checking for function curses_version in ncurses.h... yes
checking for variable curses_version in ncurses.h... no
creating Makefile
make
make: *** No rule to make target /Users/mlnw/.rvm/rubies/ruby-1.9.3-p484/include/ruby-1.9.1/ruby/thread.h', needed bycurses.o'. Stop.
ERROR: Error installing curses:
ERROR: Failed to build gem native extension.

Building has failed. See above output for more information on the failure.

Peace,
tiredpixel

does not render non-US-ASCII charcters

If the code displays non-US-ASCII characters they do not appear as expected.

Add some accents to the sample/hello.rb example, like

  show_message("Hello, World!: éàù")

The message is displayed as:

                        ┌----------------------┐
                        |                      |
                        |  Hello, World!: M-CM-)
                        M-CM- M-CM-9           |
                        └----------------------┘

Use NUM2CHTYPE()/CHTYPE2NUM() in window_attron/attroff/attrset/color_pair?

Hi, on mingw Ruby26-x64, on Windows 7, using curses-1.4.4 and the statically-linked default PDCurses, attron(color_pair(n)) doesn't have any effect, and I only get the default gray-on-black, from this example:

require 'curses'
include Curses
init_screen
start_color
init_pair(6, COLOR_BLUE, COLOR_RED)
attron(color_pair(6)) do
  setpos(5,5)
  addstr('this should be in blue on red')
end
getch
close_screen

It looks like PDCurses is compiled in 64-bit chtype mode by default, and the color bits are shifting off the end of a regular 32-bit long and getting truncated in window_attron(), window_attroff(), window_attrset(), and curses_color_pair() by the INT2FIX()/NUM2INT() macros.

Replacing these macros with NUM2CHTYPE() and CHTYPE2NUM() in the color/attr functions seems to resolve the problem and the example above works as expected.

Understanding how to redefine colors and pairs

Hi,

This has been bugging me for a while, and I do not know if I am doing something wrong, or if it is a bug in either curses, ncurses or in my terminal.

I have created a fairly elaborate script that first loads in a colorscheme, I have stolen the material colors scheme from Android to work with (please see the material-colors.json file here: https://gist.github.com/kaspergrubbe/f6e64178e3962a3609e93569dc7722ce). It then reads all the hex values, and converts it to ncurses (between 0 and 1000) like this:

@red = 'ff'
@green = 'ff'
@blue = 'ff'
[@red, @green, @blue].map{|h| h.hex / 0.255}.map(&:to_i)
#=> [1000, 1000, 1000]

I then read the materials-colors.json file, it is grouped by colorname and a weight like so:

{
  "red": {
    "50": "#ffebee",
    "100": "#ffcdd2",
    "300": "#e57373",
    "500": "#f44336",
    "700": "#d32f2f",
    "800": "#c62828",
    "900": "#b71c1c"
  },
  "pink": {
    "50": "#fce4ec",
    "100": "#f8bbd0",
    "300": "#f06292",
    "500": "#e91e63",
snipped

I then load in all the individual colours, calculate all possible combination of colour pairs where each color can be both front and back, and then I initialise curses and get it to setup the colours.

I then print lol 5 times:

  fg = @colour_map['grey']['50']
  bg = @colour_map['lightblue']['900']
  pair = @colour_map.pair(fg, bg)

  paint_effect(win, Curses.color_pair(pair.number) | Curses::A_UNDERLINE) do
    win.setpos(1,1)
    win.addstr('lol')
  end

  paint_effect(win, Curses.color_pair(1337) | Curses::A_UNDERLINE) do
    win.setpos(2,2)
    win.addstr('lol')
  end

  paint_effect(win, Curses.color_pair(10337) | Curses::A_UNDERLINE) do
    win.setpos(3,3)
    win.addstr('lol')
  end

  paint_effect(win, Curses.color_pair(0)) do
    win.setpos(4,4)
    win.addstr('lol')
  end

  paint_effect(win, Curses.color_pair(@colour_map.pair(@colour_map['grey']['50'], @colour_map['blue']['900']).number)) do
    win.setpos(5,5)
    win.addstr('lol')
  end

But the results are very strange. This is how iTerm renders it:

screenie_1540816453_064939

If you hover over it, you can see that it writes some text:

screenie_1540816517_8422852

And the OSX Terminal.app renders it very differently:

ncurses_terminal_render

However, while Terminal.app manages to reset the colors after the program exits, the same cannot be said about iTerm:

Before:
screenie_1540816908_153203

After:
screenie_1540816926_967733

I have made a whole repo here: https://github.com/kaspergrubbe/curses_colortest the only thing to test is just cloning the repo and running ruby colortest.rb.

Can you see something I can't?

Compiling curses on Fedora 28 with ncurses 6.1

When installing curses the extconf.rb configuration crashes out on checking for convertible type of chtype:

checking for tgetent() in -ltinfo... yes
checking for ncursesw/curses.h... yes
checking for initscr() in -lncursesw... yes
header: ncursesw/curses.h
library: ncursesw
checking for beep()... yes
checking for bkgd()... yes
checking for bkgdset()... yes
checking for curs_set()... yes
checking for deleteln()... yes
checking for doupdate()... yes
checking for flash()... yes
checking for getbkgd()... yes
checking for getnstr()... yes
checking for init()... no
checking for init in ncursesw/curses.h... no
checking for isendwin()... yes
checking for keyname()... yes
checking for keypad()... yes
checking for resizeterm()... yes
checking for scrl()... yes
checking for set()... no
checking for set in ncursesw/curses.h... no
checking for setscrreg()... yes
checking for ungetch()... yes
checking for addnwstr()... yes
checking for wattroff()... yes
checking for wattron()... yes
checking for wattrset()... yes
checking for wbkgd()... yes
checking for wbkgdset()... yes
checking for wdeleteln()... yes
checking for wgetnstr()... yes
checking for wresize()... yes
checking for wscrl()... yes
checking for wsetscrreg()... yes
checking for werase()... yes
checking for redrawwin()... yes
checking for waddnwstr()... yes
checking for touchwin()... yes
checking for untouchwin()... yes
checking for wtouchln()... yes
checking for is_linetouched()... yes
checking for is_wintouched()... yes
checking for def_prog_mode()... yes
checking for reset_prog_mode()... yes
checking for timeout()... yes
checking for wtimeout()... yes
checking for nodelay()... yes
checking for init_color()... yes
checking for wcolor_set()... yes
checking for use_default_colors()... yes
checking for assume_default_colors()... yes
checking for newpad()... yes
checking for unget_wch()... yes
checking for get_wch()... yes
checking for wget_wch()... yes
checking for PDC_get_key_modifiers()... no
checking for PDC_get_key_modifiers in ncursesw/curses.h... no
checking for convertible type of chtype... failed
*** ext/curses/extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

This is with RVM-built Ruby 2.4.1 on both Fedora 28 (ncurses 6.1) and Fedora 26 (ncurses 6.0) where the 6.1 version fails on the chtype check, but the 6.0 version is fine (unsigned int).

This pertains to the line in extconf.rb:

 convertible_int('chtype', [["#undef MOUSE_MOVED\n"]]+curses) or abort

Strangely the definition for chtype hasn't changed:

#if 1 && defined(_LP64)
typedef unsigned chtype;
typedef unsigned mmask_t;
#else
typedef uint32_t chtype;
typedef uint32_t mmask_t;
#endif

It's not clear why convertible_int can't detect the type.

I think there is an error in https://github.com/ruby/curses/blob/master/sample/form.rb

I just tested this example:

https://github.com/ruby/curses/blob/master/sample/form.rb

https://github.com/ruby/curses/blob/master/sample/form.rb

However had it crashed for me:

001_form.rb:46:in `driver': Unknown command (Curses::UnknownCommandError)
from 001_form.rb:46:in <main>

(I renamed it locally to 001_form.rb - makes it easier for me to test the examples
when I number them.)

The line was:

else
   form.driver(ch)

I added some debug statement. I could cause this error by hitting the "Ende" (End)
key.

The key value for this was:

360

Is this the regular behaviour of curses to crash like that?

To me it is a bit strange that form.driver(ch) would not work.

I did not test it with other keys but I assume that some other keys also cause
this issue.

Edit: Actually I tested it with page down too. That also led to the same problem,
hopefully it can be reproduced by someone else.

Merge with ncursesw?

Hi,

I am currently the maintainer of the ncursesw gem (https://rubygems.org/gems/ncursesw, originally based on the seemingly unmaintained: http://ncurses-ruby.berlios.de/) which we host as part of the sup-heliotrope project: https://github.com/sup-heliotrope/ncursesw-ruby.

It seems that this project is overlapping, but I think that our implementation is slightly more extensive. Would it be worth the effort to join the projects?

Complement issue: sup-heliotrope/ncursesw-ruby#22

Regards, Gaute

256 colours support in ncurses?

This article describes 256 colours for ncurses:

https://reversed.top/2019-02-05/more-than-256-curses-color-pairs/

The third and last piece is that most of curses examples you’ll find are using old API and there
seems to be no (at least easy to find) documentation on how to transition to the new one.

There are applications which use new API, it’s just documentation that didn’t really caught up.

Could the README mention whether this is supported or possible in the ruby-ncurses wrapper?

subpad's begin_x begin_y are not relative to parent pad after refresh

It seems like that subpad's begin_x and begin_y coordinates aren't relative to the parent pad but relative to the terminal screen if parent pad has been put on the screen using refresh. Not sure if it's the intended behavior. This example raises exception (failed to create window):

pad = Curses::Pad.new(2, 2)
pad.refresh(0, 0, 1, 1, 1, 1)
sub = pad.subpad(1, 1, 0, 0)

And this one works & looks the same on the screen - subpad is at (1, 1) in the terminal window and at (0, 0) relatively from parent pad.

pad = Curses::Pad.new(2, 2)
pad.refresh(0, 0, 1, 1, 1, 1)
sub = pad.subpad(1, 1, 1, 1)

This one works too and looks the same (refresh after pad & subpad creation):

pad = Curses::Pad.new(2, 2)
sub = pad.subpad(1, 1, 0, 0)
pad.refresh(0, 0, 1, 1, 1, 1)

It makes it difficult to create new subpads if parent pad is currently displayed on the screen, as you must know where it resides, making new subpad behave similarly to subwin. You can't put new subpad using relative coordinates to parent pad. Maybe I'm using it in a wrong way?

Can I use more than 8 colors?

Hi

I can use 8 colors provided, but I would very much like to use more than that. Is there any nice way for me to define my own colors? I can't find any reasonable resources on this idea.
This might be helpful: can_change_colors?, returns false for me, but I have no idea why.

puts "\e[1;90mt\e[0m"

will render me a nice, grey "t"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.