Open cargilcm opened 4 days ago
without putting on my code inspector goggles my first guess is that the yd command calls a function that uses tiocsti like the exit with CD operation does
This is a pretty large-size screenshot image, but termux-clipboard-set could be a potential workaround for such a function call in the termux environment depending on what other packages are used and how. I'm glad if I can write some code to this end to help out
Thanks for the catch! I forgot to add that, here's the fix: https://github.com/GiorgosXou/TUIFIManager/commit/a4f79922fc9c47ff0d691acfabbab3ea087a6eb2
(Additional info for anyone coming across this issue, you do also need to install this and pkg install termux-api
)
The top most call in the execution stack is logged below: File "/data/data/com.termux/files/usr/lib/python3.12/site-packages/TUIFIManager/TUItilities.py", line 49, in put_text_back_into_terminal_input_buffer for c in text: ioctl(1, TIOCSTI, c) ^^^^^^^^^^^^^^^^^^^^ PermissionError: [Errno 13] Permission denied
Yes, that's a trick only available for root devices, but I just found that it might be possible via this way https://github.com/gokcehan/lf/issues/140#issuecomment-464910159, too. Once I find the time I'll see what I can do, but...
I'm glad if I can write some code to this end to help out
... feel free to do so, if you like.
Awesome, I love tuifi and I especially love your passion for programming and keeping others on the up with your attention to their input etc
Thank you, Giorgios, really..as to the lf program's scripts I think this is what can be hoped for alternative to iocntl because I learned to you can't set environment variables that persist beyond the life of the process(& subprocesses) in Python so yes you have to do some bash scripting (and to tweak possibly main.py so that after endwin it prints os.getcwd() or maybe the selected file? I'll upload some code and share what I use for "-last-directory" with the autojump program.
Thank You, Giorgos
Instaed of tweaking main.py
I guess you could replace:
https://github.com/GiorgosXou/TUIFIManager/blob/a4f79922fc9c47ff0d691acfabbab3ea087a6eb2/TUIFIManager/__init__.py#L637-L638
from:
https://github.com/GiorgosXou/TUIFIManager/blob/a4f79922fc9c47ff0d691acfabbab3ea087a6eb2/TUIFIManager/__init__.py#L636-L642
with what you are trying to do.
Specifications
Android 12 aarch
termux
<!-- alacritty --version -->v.5.0.0
<!-- tuifi --version -->Describe the bug
The top most call in the execution stack is logged below:
File "/data/data/com.termux/files/usr/lib/python3.12/site-packages/TUIFIManager/TUItilities.py", line 49, in put_text_back_into_terminal_input_buffer for c in text: ioctl(1, TIOCSTI, c) ^^^^^^^^^^^^^^^^^^^^ PermissionError: [Errno 13] Permission denied
Additional context
I found a SO post that says the process must have root privileges for ioctl tiocsti operations to succeed. It would be nice if the cd path could be assigned to an variable that bash could call ie:
bash -c cd $cdpath
manually after tuifi exits if ioctl permissions are prohibitive. The error that is thrown by python crashes the terminal tab also so no further text can be displayed when typed after this type of exit. Let me know if you desire to see the whole stack trace from stderr.Thank you