Git Product home page Git Product logo

pty's Introduction

pty

GitHub repo size GitHub issues GitHub pull requests

Pty for Dart and Flutter. Provides the ability to create processes with pseudo terminal file descriptors.

Status

test

Platform JIT(Debug) AOT(Release)
Windows Crash Works
Linux x64 Works Works
Linux x86 Not tested Not tested
macOS Works Works

Usage

A simple usage example:

import 'package:pty/pty.dart';

void main() async {
  final pty = PseudoTerminal.start('bash', []);

  pty.write('ls\n');

  pty.out.listen((data) {
    print(data);
  });

  print(await pty.exitCode);
}

Features and bugs

Please file feature requests and bugs at the issue tracker.

License

This project is licensed under an MIT license.

pty's People

Contributors

devmil avatar mengyanshou avatar xtyxtyx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

pty's Issues

Provide the read() side as a stream

Cool library! It seems to me to be more useful to provide the read side as a stream. When using with terminal library the readToTerminal is somewhat problematic, and multiple terminals are not swell multiplexed for some reason. I even ran the Lite terminal on linux and multiple terminals don't work correctly. The second blocks while the first one works. I suspect it is from using the executor, but I am not sure.

web build fail

version: ^0.2.2-pre

part of error:

 ../../../.pub-cache/hosted/pub.flutter-io.cn/win32-2.1.3/lib/src/com/UserDataPaths.dart:107:32:
  Error: 'IntPtr' isn't a type.
      final retValuePtr = calloc<IntPtr>();
                                 ^^^^^^
  ../../../.pub-cache/hosted/pub.flutter-io.cn/win32-2.1.3/lib/src/com/UserDataPaths.dart:110:26:
  Error: 'NativeFunction' isn't a type.
        final hr = Pointer<NativeFunction<_get_CameraRoll_Native>>.fromAddress(
                           ^^^^^^^^^^^^^^
  ../../../.pub-cache/hosted/pub.flutter-io.cn/win32-2.1.3/lib/src/com/UserDataPaths.dart:110:18:
  Error: Method not found: 'Pointer.fromAddress'.
        final hr = Pointer<NativeFunction<_get_CameraRoll_Native>>.fromAddress(
                   ^^^^^^^^^^^
  ../../../.pub-cache/hosted/pub.flutter-io.cn/win32-2.1.3/lib/src/com/UserDataPaths.dart:123:32:
  Error: 'IntPtr' isn't a type.
      final retValuePtr = calloc<IntPtr>();
                                 ^^^^^^

【MacOS】Crash in debug mode

When the child process run unix.execve(executable.toNativeUtf8(), argv, env) ,the child process will crash,return 11.
And It's OK in Release mode.

Add stacktrace:

===== CRASH =====
si_signo=Segmentation fault: 11(11), si_code=1, si_addr=0x10fd8551b
version=2.13.1 (stable) (Fri May 21 12:45:36 2021 +0200) on "macos_x64"
pid=75053, thread=5891, isolate_group=main(0x7ff31b01b800), isolate=main(0x7ff31b020200)
isolate_instructions=10d934580, vm_instructions=10d934580
pc 0x000000010fd8551b fp 0x00007000034b65d0 Unknown symbol
pc 0x0000000114eafb27 fp 0x00007000034b6618 Unknown symbol
pc 0x0000000114ea1911 fp 0x00007000034b6718 Unknown symbol
pc 0x0000000114ea01b9 fp 0x00007000034b67c0 Unknown symbol
pc 0x0000000114e9eef6 fp 0x00007000034b6850 Unknown symbol
pc 0x0000000114e9e2ee fp 0x00007000034b6888 Unknown symbol
pc 0x0000000114e9df49 fp 0x00007000034b68b0 Unknown symbol
pc 0x0000000114e9de7b fp 0x00007000034b6908 Unknown symbol
pc 0x0000000114e9ce8d fp 0x00007000034b6938 Unknown symbol
pc 0x0000000114e9cc1e fp 0x00007000034b6998 Unknown symbol
pc 0x0000000114e9c5f8 fp 0x00007000034b69d0 Unknown symbol
pc 0x000000010fd825af fp 0x00007000034b6a48 Unknown symbol
pc 0x000000010dae4052 fp 0x00007000034b6ae0 dart::DartEntry::InvokeCode(dart::Code const&, dart::Array const&, dart::Array const&, dart::Thread*)+0x112
pc 0x000000010dae3e55 fp 0x00007000034b6b50 dart::DartEntry::InvokeFunction(dart::Function const&, dart::Array const&, dart::Array const&, unsigned long)+0x155
pc 0x000000010dae69ef fp 0x00007000034b6bb0 dart::DartLibraryCalls::HandleMessage(dart::Object const&, dart::Instance const&)+0x1df
pc 0x000000010db0da23 fp 0x00007000034b6db0 dart::IsolateMessageHandler::HandleMessage(std::__1::unique_ptr<dart::Message, std::__1::default_deletedart::Message >)+0x4f3

pc 0x000000010db3f1a4 fp 0x00007000034b6e30 dart::MessageHandler::HandleMessages(dart::MonitorLocker*, bool, bool)+0x144
pc 0x000000010db3f7c9 fp 0x00007000034b6e90 dart::MessageHandler::TaskCallback()+0x1e9
pc 0x000000010dc74ce8 fp 0x00007000034b6f20 dart::ThreadPool::WorkerLoop(dart::ThreadPool::Worker*)+0x158
pc 0x000000010dc74faf fp 0x00007000034b6f50 dart::ThreadPool::Worker::Main(unsigned long)+0x6f
pc 0x000000010dbd7605 fp 0x00007000034b6fb0 dart::ThreadStart(void*)+0xb5
pc 0x00007fff6b4fe109 fp 0x00007000034b6fd0 _pthread_start+0x94
pc 0x00007fff6b4f9b8b fp 0x00007000034b6ff0 thread_start+0xf
-- End of DumpStackTrace

Try win32 2.0.2

Thanks for your support of my package!

I've added the named pipe and other APIs that you're using that were missing from win32. If you bump up to this version, you should be able to retire your Win32Additional class.

https://pub.dev/packages/win32/versions/2.0.2

Let me know if there's anything else that I can add to help you out!

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.