From 79ef117498474dcaea60cc3f6cf14ceb39e33678 Mon Sep 17 00:00:00 2001 From: Shugo Maeda Date: Mon, 24 Aug 2026 13:31:31 +0900 Subject: [PATCH 1/3] Use PDCursesMod instead of forked PDCurses The vendored PDCurses was a fork of Bill Gray's PDCurses (now PDCursesMod) with a workaround to display full-width characters correctly on new Windows consoles. The workaround was merged upstream in PDCursesMod commit f69a0d02 and superseded by a more robust implementation in commit fac87bd9, so the fork is no longer needed. Point the submodule at Bill-Gray/PDCursesMod and update extconf.rb for the new makefile name (Makefile.mng was replaced by Makefile in the wincon port). Co-Authored-By: Claude Fable 5 --- .gitmodules | 2 +- README.md | 4 ++-- ext/curses/extconf.rb | 2 +- vendor/PDCurses | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.gitmodules b/.gitmodules index 4cec489b..fe0bc4f4 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "vendor/PDCurses"] path = vendor/PDCurses - url = https://github.com/shugo/PDCurses.git + url = https://github.com/Bill-Gray/PDCursesMod.git diff --git a/README.md b/README.md index 9a0fdc00..41f4153f 100644 --- a/README.md +++ b/README.md @@ -68,9 +68,9 @@ To install this gem onto your local machine, run `bundle exec rake install`. To 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: +It includes PDCursesMod, which is in the public domain: - https://github.com/Bill-Gray/PDCurses + https://github.com/Bill-Gray/PDCursesMod The version for Win32 console mode in the wincon subdirectory is used. diff --git a/ext/curses/extconf.rb b/ext/curses/extconf.rb index 4256a5bc..8ad94ddf 100644 --- a/ext/curses/extconf.rb +++ b/ext/curses/extconf.rb @@ -68,7 +68,7 @@ def exec_command(cmd) $pdcurses_dll_default = true else w64 = $x64 ? "_w64=1" : "" - exec_command "make -f Makefile.mng clean libs #{w64} WIDE=Y DLL=N CC=\"gcc -std=gnu17\"" + exec_command "make -f Makefile clean libs #{w64} WIDE=Y DLL=N CC=\"gcc -std=gnu17\"" FileUtils.cp("pdcurses.a", File.expand_path("libpdcurses.a", pdcurses_dir)) end ensure diff --git a/vendor/PDCurses b/vendor/PDCurses index c163cdb9..d226010b 160000 --- a/vendor/PDCurses +++ b/vendor/PDCurses @@ -1 +1 @@ -Subproject commit c163cdb9dbddbcfa3d2b71dc1c3d6815463726f4 +Subproject commit d226010b92245610bacdab205a99ae2915b99a91 From fdd82286d9fcd69deb21fd2f344c3315fe8d7e85 Mon Sep 17 00:00:00 2001 From: Shugo Maeda Date: Mon, 24 Aug 2026 14:07:51 +0900 Subject: [PATCH 2/3] Link winmm for the bundled PDCursesMod on mingw PDCursesMod's PDC_beep() calls PlaySound(), so linking the static pdcurses library fails with an undefined reference to __imp_PlaySoundW unless winmm is also linked. The mswin build is not affected because pdcurses.dll is linked against winmm.lib by Makefile.vc. Co-Authored-By: Claude Fable 5 --- ext/curses/extconf.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ext/curses/extconf.rb b/ext/curses/extconf.rb index 8ad94ddf..853ff142 100644 --- a/ext/curses/extconf.rb +++ b/ext/curses/extconf.rb @@ -76,6 +76,9 @@ def exec_command(cmd) end FileUtils.cp(File.expand_path("curses.h", pdcurses_dir), File.expand_path("pdcurses.h", pdcurses_dir)) + # PDCursesMod calls PlaySound() in PDC_beep(), so the static library + # needs winmm at link time + have_library("winmm") if $mingw $library_candidates = [ ["pdcurses.h", ["pdcurses"]] ] From 3b1b11ea017994db8026a0b4c7bd1686480c995d Mon Sep 17 00:00:00 2001 From: Shugo Maeda Date: Mon, 24 Aug 2026 14:17:18 +0900 Subject: [PATCH 3/3] Rename vendor/PDCurses to vendor/PDCursesMod Co-Authored-By: Claude Fable 5 --- .gitmodules | 4 ++-- ext/curses/extconf.rb | 2 +- lib/curses.rb | 2 +- vendor/{PDCurses => PDCursesMod} | 0 4 files changed, 4 insertions(+), 4 deletions(-) rename vendor/{PDCurses => PDCursesMod} (100%) diff --git a/.gitmodules b/.gitmodules index fe0bc4f4..51c75bca 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ -[submodule "vendor/PDCurses"] - path = vendor/PDCurses +[submodule "vendor/PDCursesMod"] + path = vendor/PDCursesMod url = https://github.com/Bill-Gray/PDCursesMod.git diff --git a/ext/curses/extconf.rb b/ext/curses/extconf.rb index 853ff142..e7d2bb08 100644 --- a/ext/curses/extconf.rb +++ b/ext/curses/extconf.rb @@ -55,7 +55,7 @@ def exec_command(cmd) if $use_bundled_pdcurses $pdcurses_wide_default = true $curses_version_default = "function" - pdcurses_dir = File.expand_path("../../vendor/PDCurses", __dir__) + pdcurses_dir = File.expand_path("../../vendor/PDCursesMod", __dir__) $idefault = $ldefault = pdcurses_dir wincon_dir = File.expand_path("wincon", pdcurses_dir) old_dir = Dir.pwd diff --git a/lib/curses.rb b/lib/curses.rb index 424729a3..d47b7580 100644 --- a/lib/curses.rb +++ b/lib/curses.rb @@ -1,4 +1,4 @@ -pdcurses_dll = File.expand_path("../vendor/PDCurses/pdcurses.dll", __dir__) +pdcurses_dll = File.expand_path("../vendor/PDCursesMod/pdcurses.dll", __dir__) if File.exist?(pdcurses_dll) path = ENV["PATH"] dir = File.dirname(pdcurses_dll) diff --git a/vendor/PDCurses b/vendor/PDCursesMod similarity index 100% rename from vendor/PDCurses rename to vendor/PDCursesMod