termux-widget icon indicating copy to clipboard operation
termux-widget copied to clipboard

Allow files to be opened with a shortcut

Open tomtom opened this issue 7 years ago • 5 comments

When in a file browser, users can open files with eligible apps. Users can select termux to open a file, which will make termux to copy the file to Downloads.

It would preferable, if termux could make use of the shortcuts defined for termux-widget to open a file sent to termux.

Example:

  • Define a shortcut for VIM
  • Open a file from a file browser and send it to termux
  • Choose the VIM shortcut to handle the file
  • The file is opened in vim and the user won''t hardly notice vim isn't a native android app.

There actually is no need to copy the file to Downloads first, since the storage is available via ~/storage/shared once termux-setup-storage is run.

Regards

tomtom avatar Aug 04 '17 09:08 tomtom

I just realized I need this in my life too :) Opening text files with Termux's vim (or your favourite editor) directly from a file browser seems a must to me and I wonder why this feature request ended up stalled...

Will this ever be considered?

araujorm avatar Apr 07 '21 23:04 araujorm

@araujorm Your choice is termux-file-editor, if you want to open/edit files by clicking on them in Android file managers. See https://wiki.termux.com/wiki/Intents_and_Hooks

ghost avatar Apr 08 '21 00:04 ghost

@xeffyr Hi. Many thanks for the prompt response.

I tried your suggestion but termux still tries to place the file in downloads folder instead of opening it directly in the editor. The symlink points to vim in the ~/bin directory, and manually running it, it works.

Running latest release from f-droid.

Am I missing something?

araujorm avatar Apr 08 '21 09:04 araujorm

@araujorm No problems on seveal devices Shots grafik When I press EDIT nano downloads/.bashrc is in a NEW SESSION (copy of ../.bashrc)!

RalfWerner avatar Apr 08 '21 11:04 RalfWerner

@RalfWerner I see that but I'm afraid that's barely useful. I would expect to be able to edit the file itself (meaning possibly modify it), not edit a copy of it and leave that copy inside termux's ~/downloads... Which again, I can't see the point :(

Perhaps I'm not making myself clear? If that's the case please tell me.

If on the other hand it's a known bug, do you know if there are plans to solve it?

(Note: if it's the intended behaviour, I guess then I must really be missing something, but if that's the case then please tell me so that I won't insist)

araujorm avatar Apr 08 '21 12:04 araujorm