termshot icon indicating copy to clipboard operation
termshot copied to clipboard

failed to enable RAW mode for stdin inappropriate ioctl for device

Open Arshit007 opened this issue 2 years ago • 6 comments

Docker File

FROM ubuntu RUN wget https://github.com/homeport/termshot/releases/download/v0.2.2/termshot_0.2.2_linux_amd64.tar.gz RUN tar -xf termshot_0.2.2_linux_amd64.tar.gz RUN chmod +x termshot
RUN cp termshot /usr/bin COPY run.py run.py
CMD ["python3","run.py"]

run.py -

import os os.system("termshot -c -- ls") os.system("ls -lah")

Arshit007 avatar Dec 08 '21 22:12 Arshit007

Interesting. So far, I have no idea what that could be. Have to give it a try, so thanks for providing the environment.

HeavyWombat avatar Dec 09 '21 13:12 HeavyWombat

I am facing the same issue. Environment - Arch, node application with typescript I face this error only when I try to execute termshot through an application and not directly through the terminal

Mannan-Goyal avatar Feb 08 '22 20:02 Mannan-Goyal

I am curious, I had some ideas with regards to this issue, but no lead and sadly not enough time yet to fully dive into it. For sure, it is about the internal handling on the input stream that termshot tries to parse to identify the SGRs I need for the colors. @Mannan-Goyal Could you explain how you execute termshot. Is is like a command call like using the os/exec package or similar?

HeavyWombat avatar Feb 08 '22 20:02 HeavyWombat

I have tried using the exec/spawn methods that are included in the inbuilt 'child_process' package and I have also tried using the shelljs package also but I got the same error with all of them.

Mannan-Goyal avatar Feb 08 '22 22:02 Mannan-Goyal

I'm facing this issue when launching termshot from crontab.

solanav avatar Sep 20 '22 06:09 solanav

I can reproduce it now, I think:

$ termshot cat <<<'hello'
╭ failed to enable RAW mode for stdin
│ inappropriate ioctl for device
╵

HeavyWombat avatar Sep 20 '22 19:09 HeavyWombat

Issue got closed with the merge of the PR. There will be a new release. Please let me know whether this fixed the issue for you.

HeavyWombat avatar Oct 12 '22 14:10 HeavyWombat