{"id":20469266,"url":"https://github.com/terminalstudio/flutter_pty","last_synced_at":"2026-02-26T08:40:39.741Z","repository":{"id":39712882,"uuid":"491390552","full_name":"TerminalStudio/flutter_pty","owner":"TerminalStudio","description":"Pty for Flutter. Provides the ability to create processes with pseudo terminal file descriptors.","archived":false,"fork":false,"pushed_at":"2024-09-03T12:46:52.000Z","size":470,"stargazers_count":24,"open_issues_count":11,"forks_count":21,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-12-10T08:51:29.727Z","etag":null,"topics":["flutter","pseudo-terminal","pty"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/flutter_pty","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TerminalStudio.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2022-05-12T06:26:23.000Z","updated_at":"2024-11-03T17:41:42.000Z","dependencies_parsed_at":"2024-02-25T14:28:50.032Z","dependency_job_id":"47db52ef-f439-49ce-8bf8-cb11ff8a89a3","html_url":"https://github.com/TerminalStudio/flutter_pty","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TerminalStudio%2Fflutter_pty","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TerminalStudio%2Fflutter_pty/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TerminalStudio%2Fflutter_pty/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TerminalStudio%2Fflutter_pty/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TerminalStudio","download_url":"https://codeload.github.com/TerminalStudio/flutter_pty/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230445926,"owners_count":18227060,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["flutter","pseudo-terminal","pty"],"created_at":"2024-11-15T14:08:31.954Z","updated_at":"2026-02-26T08:40:39.689Z","avatar_url":"https://github.com/TerminalStudio.png","language":"C","readme":"# flutter_pty\n\n[![ci](https://github.com/TerminalStudio/flutter_pty/actions/workflows/ci.yml/badge.svg)](https://github.com/TerminalStudio/flutter_pty/actions/workflows/ci.yml)\n[![pub points](https://badges.bar/flutter_pty/pub%20points)](https://pub.dev/packages/flutter_pty)\n\n\nThis is an experimental package to explore the possibilities of using native\ncode to implement PTY instead of pure FFI and blocking isolates. It's expected to be\nmore stable than the current implementation ([pty](https://pub.dev/packages/pty)).\n\n## Platform\n\n\n| Linux | macOS | Windows | Android |\n| :---: | :---: | :-----: | :-----: |\n|   ✔️   |   ✔️   |    ✔️    |    ✔️    |\n\n## Quick start\n\n```dart\nimport 'package:flutter_pty/flutter_pty.dart';\n\nfinal pty = Pty.start('bash');\n\npty.output.listen((data) =\u003e ...);\n\npty.write(Utf8Encoder().convert('ls -al\\n'));\n\npty.resize(30, 80);\n\npty.kill();\n```\n\n---\n\n## Project stucture\n\nThis template uses the following structure:\n\n* `src`: Contains the native source code, and a CmakeFile.txt file for building\n  that source code into a dynamic library.\n\n* `lib`: Contains the Dart code that defines the API of the plugin, and which\n  calls into the native code using `dart:ffi`.\n\n* platform folders (`android`, `ios`, `windows`, etc.): Contains the build files\n  for building and bundling the native code library with the platform application.\n\n## Buidling and bundling native code\n\nThe `pubspec.yaml` specifies FFI plugins as follows:\n\n```yaml\n  plugin:\n    platforms:\n      some_platform:\n        ffiPlugin: true\n```\n\nThis configuration invokes the native build for the various target platforms\nand bundles the binaries in Flutter applications using these FFI plugins.\n\nThis can be combined with dartPluginClass, such as when FFI is used for the\nimplementation of one platform in a federated plugin:\n\n```yaml\n  plugin:\n    implements: some_other_plugin\n    platforms:\n      some_platform:\n        dartPluginClass: SomeClass\n        ffiPlugin: true\n```\n\nA plugin can have both FFI and method channels:\n\n```yaml\n  plugin:\n    platforms:\n      some_platform:\n        pluginClass: SomeName\n        ffiPlugin: true\n```\n\nThe native build systems that are invoked by FFI (and method channel) plugins are:\n\n* For Android: Gradle, which invokes the Android NDK for native builds.\n  * See the documentation in android/build.gradle.\n* For iOS and MacOS: Xcode, via CocoaPods.\n  * See the documentation in ios/flutter_pty.podspec.\n  * See the documentation in macos/flutter_pty.podspec.\n* For Linux and Windows: CMake.\n  * See the documentation in linux/CMakeLists.txt.\n  * See the documentation in windows/CMakeLists.txt.\n\n## Binding to native code\n\nTo use the native code, bindings in Dart are needed.\nTo avoid writing these by hand, they are generated from the header file\n(`src/flutter_pty.h`) by `package:ffigen`.\nRegenerate the bindings by running `flutter pub run ffigen --config ffigen.yaml`.\n\n## Invoking native code\n\nVery short-running native functions can be directly invoked from any isolate.\nFor example, see `sum` in `lib/flutter_pty.dart`.\n\nLonger-running functions should be invoked on a helper isolate to avoid\ndropping frames in Flutter applications.\nFor example, see `sumAsync` in `lib/flutter_pty.dart`.\n\n## Flutter help\n\nFor help getting started with Flutter, view our\n[online documentation](https://flutter.dev/docs), which offers tutorials,\nsamples, guidance on mobile development, and a full API reference.\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fterminalstudio%2Fflutter_pty","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fterminalstudio%2Fflutter_pty","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fterminalstudio%2Fflutter_pty/lists"}