SwiftCurses

1.1.0

Make terminal applications quickly with ncurses + Swift
Jomy10/SwiftCurses

What's New

1.1.0

2024-12-29T12:03:31Z

This version requires new macOS version: 10.15

Interrupt handling: ncurses will now be properly cleaned up on an interrupt

Full Changelog: 1.0.3...1.1.0

SwiftCurses

examples | documentation


SwiftCurses is a Swifty wrapper for ncurses.

ncurses - CRT screen handling and optimization package

Hello World

import SwiftCurses

try initScreen() { scr in
    try scr.print("Hello world !!!")
    scr.refresh()
    try scr.getChar()
}

Installation

ncurses must be installed on the system.

In your swift package:

dependencies: [
  .package(url: "https://github.com/jomy10/SwiftCurses.git", branch: "master")
]

In a swift target:

.target(
  name: "MyTarget",
  dependencies: ["SwiftCurses"]
)

Documentation / tutorials / links

There is a great ncurses tutorial you can find here, the examples in this repository show the examples seen in the tutorial.

NCurses documentation can be found here, though keep in mind some functions may be missing/have a different name.

ncurses info

Running the examples

swift run Examples [name of the example (see main.swift)]

Questions

Feel free to ask any questions.

Contributing

Always looking at improving this library, feel free to leave suggestions/pull requests.

TODO

macOS version compatibility

macOS version library version
< 10.15 <= 1.0.3
>= 10.15 latest

License

Since the original is licensed under the MIT license, this library is also licensed under the MIT license.

Description

  • Swift Tools 5.7.0
View More Packages from this Author

Dependencies

Last updated: Thu May 15 2025 08:58:39 GMT-0900 (Hawaii-Aleutian Daylight Time)