Skip to content
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

Feature Request: Find/search within the console output #212

Closed
NHDaly opened this issue Dec 21, 2018 · 7 comments
Closed

Feature Request: Find/search within the console output #212

NHDaly opened this issue Dec 21, 2018 · 7 comments

Comments

@NHDaly
Copy link

NHDaly commented Dec 21, 2018

Feature Request:

Related to: JunoLab/atom-julia-client#330

One of the only reasons I ever switch back to a terminal and the regular julia REPL is when i want to search through my REPL's terminal output. (As one example, when printing the @code_typed of a big function, and i want to find a specific function call within it, i find myself switching back to the terminal, opening Julia, and rerunning all the commands I need to get me back to that output.)

It'd be super great if the default Atom find-and-replace pane was able to search the contents of the Console! But if that's not possible, I guess having our own searchbox that opens on cmdf would also work.

@NHDaly NHDaly changed the title Find/search within the console output Feature Request: Find/search within the console output Dec 21, 2018
@NHDaly
Copy link
Author

NHDaly commented Dec 21, 2018

I wasn't sure if this belongs here or in https://github.com/JunoLab/atom-julia-client. I would've guessed it belongs in the other repo, but the "New Issue" page says:

Please open your issue at https://github.com/JunoLab/Juno.jl/issues/new unless you've been explicitly pointed here by a Juno developer.

😁

@pfitzseb
Copy link
Member

xterm.js has a addon for this here, but we'll still need to write our own UI for that. Re-using Atom's find-and-replace panel is probably not super easy.

I wasn't sure if this belongs here or in https://github.com/JunoLab/atom-julia-client. I would've guessed it belongs in the other repo

Yeah, I'd rather have all user issues/feature requests here so I don't lose track of them spread across 5 repos :)

@NHDaly
Copy link
Author

NHDaly commented Dec 27, 2018

Ah okay cool! So Xterm.js is the package we use to implement the terminal in the Console pane? Neat. I can look at that and see what i can do..

@NHDaly
Copy link
Author

NHDaly commented Dec 27, 2018

--- okay after some digging I see that Xterm.js is what's used in atom-ink to implement the terminal.

So basically we'd have to just expose xterm.js's search addon API through the UI in Ink? That seems reasonable!

Re-using Atom's find-and-replace panel is probably not super easy.

Bummer. I'll look into it a bit more; ideally we could hook them up so that pressing "find next" on the Atom find-and-replace panel would call the xterm search api. But yeah that's probably hard. Thanks sebastian! :)

@NHDaly
Copy link
Author

NHDaly commented Dec 28, 2018

Fwiw, here's how the the find-and-replace sets which Pane it's looking in when it does the searching:
https://github.com/atom/find-and-replace/blob/71a80c0b793423e7166fd26c2f39e932b9b5cd14/lib/find.coffee#L34

It calls observeActivePaneItem on the workspace to set up a callback where every time a Pane is activated, the Model in the find-and-replace package is updated to point to the newly activated Pane's TextEditor. (I don't really understand how the Pane is being converted into a TextEditor there, though...)

So, maybe we could hook into the find-and-replace package by creating a fake TextEditor -- a class that implements the TextEditor interface but calls xterm.js for its scan function -- and adding it to the Pane that contains the Console? :)

@NHDaly
Copy link
Author

NHDaly commented Dec 28, 2018

Cool! So i think the find-and-replace integration might not be too hard! :)

I have a first-pass rough implementation here: NHDaly/atom-ink@6c006fe

Next I'm going to look into the xterm.js search functionality you pointed out, and try to hook that up to the search API! :)

@NHDaly
Copy link
Author

NHDaly commented Dec 28, 2018

(The xterm.js search api is being refactored. We may want to wait until that is done. See discussion in xtermjs/xterm.js#1833)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants