-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Shortcut "ctrl+e
> exit with cd" (non rooted) & command yd
, not working
#121
Comments
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 |
ctrl+e
> exit with cd
(on non rooted termux environment) & command yd
, not working
ctrl+e
> exit with cd
(on non rooted termux environment) & command yd
, not working ctrl+e > "exit with cd"
(non rooted) & command yd
, not working
ctrl+e > "exit with cd"
(non rooted) & command yd
, not working ctrl+e
> exit with cd" (non rooted) & command yd
, not working
Yes, that's a trick only available for root devices, but I just found that it might be possible via this way gokcehan/lf#140 (comment), too. Once I find the time I'll see what I can do, but...
... 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 TUIFIManager/TUIFIManager/__init__.py Lines 637 to 638 in a4f7992
from: TUIFIManager/TUIFIManager/__init__.py Lines 636 to 642 in a4f7992
with what you are trying to do. |
crossreff: #85 |
Exit with CD function output messes up the terminal prompt display when It WOULD BE great if there was/is a way to test whether the tuifi program is being executed under root privilege. If you I have no sysadmin experience but from an article on stack exchange I'd be curious if you can determine whether the process has root privileges by executing subprocess in Python with the command logname and testing for equality to "root"? |
I know.
There's no need for such a thing. if simply this works gokcehan/lf#140 (comment), I'll ditch the root-trick completly. I just don't have the time to work on it, right now. |
Lf's exit with CD directs the session location to the relevant directory but lf is written in go which I had wondered was there something special in the go binaries different from pythons that allowed their program to achieve this. I have some other quirks that are not meeting my needs with the documented behavior or tuifi not playing out as described (non rooted termux issues again I think) but I'll file those under different support tickets, appropriately. I had noticed other tui file managers writing the files to a file and currently that's my only way of knowing how to solve the issue and I had just finished my commit solving that way when I broke my termux by a faulty alias in bashrc back to coding at base level zero lol Edit: tuifi inside termux when navigating from TERMUX_HOME to shared storage will only get you back to TERMUX_HOME via a previously set marker if you're not rooted ie backspace does not do it Thanks Giorgos! Edit: I was feeling frustrated with tuifi not functioning as I thought it would and was able to address some of those eccentricities by fixing a mistake I'd made by reinstalling termux and running pkg up before python setup.py install |
Seeing how your are the author of unicurses I would feel mostly certain that it doesn't remain unknown yet that piping the output of a python curses program will most likely include control séquences and escape characters that are hard to filter out but to use the tuifi program's command line output "you" could (read: I am) use Can I submit via pull request? For my research, I'm giving this an"issue closed" tag. Fwiw if Reiteration, TUIFIManager and ecosystem for my learning about curses gets a double thumbs up |
Not the author, just a maintainer.
Feel free to do so. Or simply link me to your fork changes and I'll do the the rest by my own (while ensuring to co-author you), as I'm concerned of few things that may need to be changed. |
I think I have committed a working tuifi-cd if you will command. In my bash I have named it How does this attempt look to you? |
Looks ok. Don't worry, I'll fix what's needed once I have the time, right now I'm working on another project and that's why I'm not active on the issue. Thanks |
Specifications
Android 12 aarch
termux
v.5.0.0
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
The text was updated successfully, but these errors were encountered: