https://github.com/jomy10/swiftcurses
Make terminal applications quickly with ncurses + Swift
https://github.com/jomy10/swiftcurses
curses ncurses ncurses-library swift terminal ui
Last synced: about 1 year ago
JSON representation
Make terminal applications quickly with ncurses + Swift
- Host: GitHub
- URL: https://github.com/jomy10/swiftcurses
- Owner: Jomy10
- License: mit
- Created: 2023-02-13T19:47:07.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2024-12-29T14:06:38.000Z (over 1 year ago)
- Last Synced: 2025-04-04T07:06:03.297Z (about 1 year ago)
- Topics: curses, ncurses, ncurses-library, swift, terminal, ui
- Language: Swift
- Homepage:
- Size: 137 KB
- Stars: 7
- Watchers: 1
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
SwiftCurses is a Swifty wrapper for ncurses.
> ncurses - CRT screen handling and optimization package
## Hello World
```swift
import SwiftCurses
try initScreen() { scr in
try scr.print("Hello world !!!")
scr.refresh()
try scr.getChar()
}
```
## Installation
[ncurses](https://invisible-island.net/ncurses#packages) must be installed on the system.
In your swift package:
```swift
dependencies: [
.package(url: "https://github.com/jomy10/SwiftCurses.git", branch: "master")
]
```
In a swift target:
```swift
.target(
name: "MyTarget",
dependencies: ["SwiftCurses"]
)
```
## Documentation / tutorials / links
There is a great ncurses tutorial you can find [here](https://tldp.org/HOWTO/NCURSES-Programming-HOWTO/),
the [examples in this repository](/Sources/Examples) show the examples seen in the tutorial.
NCurses documentation can be found [here](https://invisible-island.net/ncurses/man/ncurses.3x.html),
though keep in mind some functions may be missing/have a different name.
[ncurses info](https://invisible-island.net/ncurses/)
### Running the examples
```sh
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
- [x] border: https://invisible-island.net/ncurses/man/curs_border.3x.html
- [x] scr_dump: https://invisible-island.net/ncurses/man/curs_scr_dump.3x.html
- https://tldp.org/HOWTO/NCURSES-Programming-HOWTO/otherlib.html
- fill in the todos
## License
Since the original is licensed under the MIT license, this library is also
licensed under the [MIT license](LICENSE).