Coder Social home page Coder Social logo

csharp-ncurses's People

Contributors

rnowley avatar tkf144 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

csharp-ncurses's Issues

Build and run in VS2017 on Windows

With a few simple changes, I think the project can easily address the problem of different ncurses library names on different target platforms. I've seen a few comments on SO and your blog where Windows devs can't quite figure out how to get this project going. This way it's literally a load-and-launch project from VS2017 (as long as you also drop the DLL into a %path% folder, as described in the wiki).

The changes are in this branch on my fork:
https://github.com/MV10/csharp-ncurses/tree/library-from-build-target

  • This adds Runtime Identifiers (RID) and constants for win-x64, linux-x64, and osx-64
  • This and this sets the const cursesLib based on the RID target

I've used RIDs to create cross-platform ASP.NET Core SCDs (self-contained deployments) -- I build and test on Windows, then deploy a release build to a headless Linux farm.

This is why I posted here instead of opening a PR: I develop on Windows. I'm not sure of the impact of this change for non-Windows developers. As-written, the #if block defaults to the Windows DLL. Will VSCode on OSX launch in debug with the correct RID so that debug works? Can someone try this and let me know?

Info for users running MSYS2/Git for Windows shells

Hi Raymond,

Thanks for providing this library. I'm beginning to dabble in an ncurses project and it should prove helpful.

I had some small issues getting the Hello World sample running on Windows 10 using Git Bash inside ConEmu, and thought it may benefit someone else if it were documented. I'm not sure if this is assumed knowledge for the target audience of your library (or even a legitimate issue), so I have not submitted a PR to amend README.md, nor created a Wiki page.

Learnings:

  • Get libncursesw6.dll. Version 6.1 available here as of 04-2018.
    • Place it somewhere that features in %PATH%.
    • Reference it in ..\csharp-ncurses\csharp-ncurses\NativeMethods.cs
  • Start a Bash shell. I use ConEmu, via a task which runs the following: "C:\Program Files\Git\git-cmd.exe" --no-cd --command=usr/bin/bash.exe -l -i:
    • pwd -> [..]/sample/helloWorld
    • echo $TERM -> cygwin
    • dotnet build
    • dotnet run -> Error opening terminal: cygwin.
    • export TERMINFO="C:\Program Files\Git\usr\lib\terminfo"
    • dotnet run -> Goodbye cruel #C programming as expected

Pointing ncurses to the Cygwin terminfo file ("C:\Program Files\Git\usr\lib\terminfo\63\cygwin") via $TERMINFO seems to be the key. Mintty (what git-bash.exe wraps) launches Bash with $TERM=xterm, $TERMINFO=, and can run the Hello World sample OK, but it seems git-cmd.exe, running Bash, requires setting $TERMINFO.

Hope that helps someone.

Cheers,
Tom

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.