fman icon indicating copy to clipboard operation
fman copied to clipboard

Embedded Terminal

Open mherrmann opened this issue 7 years ago • 13 comments

This would have the huge advantage that you could easily navigate directories with fman, seeing what's inside them, yet at the same time you would be able to run commands.

Unfortunately, implementing a terminal emulator is a large task, and it will be difficult to do so well that it actually yields benefits over the many existing Terminal integrations / solutions.

Several users (in particular people who used FAR) have been very keen on this feature. I'm quite strongly against it, because it is a monumental task, will suck in comparison to "actual" terminals at the end of the day, and (imho) doesn't provide that much added benefit over using F9 and F11 in fman with a little bit of Alt-Tab.

mherrmann avatar Mar 21 '17 13:03 mherrmann

Maybe add a single text-input line, that executes manually entered shell commands in the active pane. Output would go to system's default terminal or could be caught by software allowing for it (ConEmu).

bmix avatar Apr 12 '17 22:04 bmix

I never liked terminal integrated in file managers. But running commands on file/files is very useful - you may want to implement feature that will concat relative/absolute paths of selected files in fman and allow user to edit it to run arbitrary command. Something like cmd /k "7z. a new.7z file1 file2 file3.

vovcacik avatar Jul 03 '17 18:07 vovcacik

Sorry, @vovcacik, I don't understand the example you gave. One thing that's already there is F11 - CopyPathsToClipboard. It copies the full path of the selected files to the clipboard. This can then be pasted into a terminal.

mherrmann avatar Jul 04 '17 04:07 mherrmann

Ah I see, that would do the trick. My idea was that user would select files in fman, than he would be presented with simple input line (prompt) where paths of the files would be prefilled. Then he would edit the line to his needs - like adding 7z a or whatever really. Once he confirm this dialog a normal terminal window would appear and carry out the command and stayed open once it finishes (to see the output).

But with the F11 shortcut, I think this scenario is already pretty straightforward right now.

vovcacik avatar Jul 04 '17 10:07 vovcacik

Ok good :)

mherrmann avatar Jul 04 '17 10:07 mherrmann

Completely agree on your reasoning for not implementing your own terminal. However, functionality-wise, the holy grail for terminal/file manager interactivity for me is the ability to have their cwds kept in sync so you can seamlessly jump between the two. I haven't had a chance to look at your plugin API yet, but I'd suggest that's a place worth examining. It would be worth probing to see if there's anything missing that would enable a plugin to (minimally) with a quick command or (preferably) automatically keep the two in the same directory.

crispinb avatar Dec 19 '18 01:12 crispinb

That is completely doable. When I get a chance, I'll add it to the iTerm plugin. The problem facing is that it will be terminal program specific since there is not generic way of doing it. But, people can create the similar plugin for their favorite terminal program! Then, just load the one you want to use.

On Wed, Dec 19, 2018 at 8:09 AM Crispin Bennett [email protected] wrote:

Completely agree on your reasoning for not implementing your own terminal. However, functionality-wise, the holy grail for terminal/file manager interactivity for me is the ability to have their cwds kept in sync so you can seamlessly jump between the two. I haven't had a chance to look at your plugin API yet, but I'd suggest that's a place worth examining. It would be worth probing to see if there's anything missing that would enable a plugin to (minimally) with a quick command or (preferably) automatically keep the two in the same directory.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/fman-users/fman/issues/39#issuecomment-448431844, or mute the thread https://github.com/notifications/unsubscribe-auth/ACX0x9CaiacEvWlm5i-AMrH1HD9GkrbAks5u6ZHOgaJpZM4Mj0Kd .

raguay avatar Dec 19 '18 01:12 raguay

Yes it would need to be per-plugin. I just wasn't sure whether or not the current plugin API was rich enough to do this. If it is, then that's terrific.

crispinb avatar Dec 19 '18 04:12 crispinb

Yes. There is a hook for when a directory changes. So, when a directory changes and you want to sync, issue the command to the terminal program. But, it will cost speed of fman as it will at least check for syncing every time a directory changes.

On Wed, Dec 19, 2018 at 11:52 AM Crispin Bennett [email protected] wrote:

Yes it would need to be per-plugin. I just wasn't sure whether or not the current plugin API was rich enough to do this. If it is, then that's terrific.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/fman-users/fman/issues/39#issuecomment-448468924, or mute the thread https://github.com/notifications/unsubscribe-auth/ACX0xy-QTCfMsJ2xusGB5qmSG5kLvIbfks5u6cX-gaJpZM4Mj0Kd .

raguay avatar Dec 19 '18 05:12 raguay

As @raguay pointed out, it is possible to write an fman plugin that keeps a terminal in sync with regards to the current directory. I don't even think this will cause any noticeable slowdown in fman. The method one would have to overwrite is DirectoryPaneListener#on_path_changed. This is invoked asynchronously by fman, ie. in the background.

mherrmann avatar Dec 20 '18 06:12 mherrmann

I just updated OpenIterm2 plugin to allow for directory change following. Give it a try.

raguay avatar Dec 20 '18 16:12 raguay

@raguay thanks - I've been mac-free since July so I can't, but I'm glad others will benefit from your work! @mherrmann thanks for the info. I'm hoping to have a bit of time over the holidays to put together a plugin for my current os/terminal combination (Terminus on Win10), so that'll be helpful.

crispinb avatar Dec 20 '18 23:12 crispinb

@crispinb Well, you can look at it on GitHub and see how to do it with your manager. So, are you windows or linux? I might be able to help you with Linux, but I don't have a working Windows system right now. My VM only have XP.

raguay avatar Dec 25 '18 03:12 raguay