vercel / hyper

A terminal built on web technologies

Home Page:https://hyper.is

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Export the text as ctrl + s doesn't exist in HyperTerminal

theohamdan opened this issue · comments

  • I am on the latest Hyper.app version
  • I have searched the issues of this repo and believe that this is not a duplicate
  • OS version and name: <macOS HighSierra 10.13.2>
  • Hyper.app version: < hyper 1.4.8 >
  • Link of a Gist with the contents of your .hyper.js:

Issue
Hi guys, when I open HyperTerminal I don't find "export the text as file" (like when I do ctrl + s) and it's very important as much in Terminal, then I want to know if anyone had already found this feature and I'm ready to participate your propositions

export text as ?

as a file , iterm2 and Terminal.app has this feat
first I ever heard of it too

@ppot sorry, yes it's as file

@lesce thanks for your participation

Then do you have any idea about the solution?

@mhamdan95 I can take a look tomorrow ,
I'm not very familiar with the codebase or electron apps for that matter , just started this week

Perfect idea for a plugin.
Saving a selection or all history 😍

@chabou that's true, thanks a lot 👍

hey guys, I didn't fix the feature yet, but I developed my ideas, and finally I found the root of the feature, it's in the folder app -> renderer in the file bundle.js

We have to add some operation to make work the "Export the text as"
Need your help 😟

@chabou @lesce @ppot
Hi guys, do you have any proposition please?

@NicholasMorrison and I will be working on this issue in the coming weeks.

yeaaah @neil-orans it will be just amazing, we can exchange our ideas together ;)

And I added the "save as" in the program but without the functionality. Then actually we have to do the function that makes the "save as" run.

@mhamdan95 We have written and confirmed saving text that exists in the hyper terminal window. Just need to test it on multiple operating systems. The plugin will be released soon.

Be sure to target our canary version (our upcoming v2).

@chabou If we simply pull from the canary branch and test our plugin with that version, would this suffice? Or is the canary version subject to a lot more change? The plugin mainly relies on being able to access the "term" object that is passed down to the _onTerminal function in most React Components that are implemented as hyper plugins. If the organization of the contents of the term object could possibly change a lot in the coming release of v2, then we will need to revise the plugin a bit.

It will be enough to test upon current canary (This should be our last canary before shipping our v2).
You'll still have access to Terminal instance (thanks to onTerminal hook), but be careful: xtermjs is now used instead of hterm as underlying terminal lib.

@chabou the onTerminal hook doesn't seem to be working/executing if we use the script in the canary. Is this a known issue?

Yes, onTerminal hook doesn't work anymore. I don't know if we need to restore it because it seems quite too specific (and plugin that used it, would have an xtermjs instance and not a hterm one).

If you want to access xtermjs instance, you should use onDecorated hook on your Term decorator to get Term component instance and access to its term property.

The plugin is stable now on 1.4.8 and 2.0.0 (if you are using macOS) and can be found on npm or GitHub. Certain features are not fully working on Linux, and we haven't gotten around to testing Windows yet.

Feel free to give it a whirl and report any bugs or suggestions on our issues tracker!

@neil-orans Thank you so much for this plugin.
Do not hesitate to submit it to our store: https://github.com/zeit/hyper-site/wiki/Submitting-a-new-plugin-or-theme-to-Hyper-Store

No problem! Credit also goes to @NicholasMorrison since much of this code was produced via pair-programming. Once we can do a little more testing, we will release and publish the 1.0.0 to npm and submit it to the hyper-store. Thanks for your help along the way @chabou!