flutter_pty icon indicating copy to clipboard operation
flutter_pty copied to clipboard

example doesnt work in release mode on macos

Open Ansh-Rathod opened this issue 1 year ago • 3 comments

i tried the example in the release mode on macos and it didn't recognise the command brew, I tried running brew --version in debug mode it works.

Ansh-Rathod avatar Nov 11 '24 07:11 Ansh-Rathod

Related: https://github.com/Homebrew/brew/issues/15833

You can fix it by adding

final homeDir = Platform.environment['HOME'] ?? '';

pty.write(const Utf8Encoder().convert('export HOME=$homeDir' + carriageReturn));

after pty.start.

This sets $HOME which is needed by process for it to be able to run brew.

damywise avatar Nov 11 '24 09:11 damywise

will it be able to run ffmpeg or any other installed tools too this way?

Ansh-Rathod avatar Nov 11 '24 10:11 Ansh-Rathod

From my test on my machine™️ it will

damywise avatar Nov 11 '24 10:11 damywise