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

DS9 REPL Mode #3

Open
mileslucas opened this issue Dec 23, 2020 · 1 comment
Open

DS9 REPL Mode #3

mileslucas opened this issue Dec 23, 2020 · 1 comment

Comments

@mileslucas
Copy link
Member

I've had this neat idea of creating a REPL mode for DS9. The idea is that, instead of writing something like this-

julia> DS9.connect()
"7f000001:59505"

julia> DS9.set("frame new")
julia> X = randn(512, 512);
julia> DS9.set(X)

you could do this-

julia>|
DS9> connect
"7f000001:59505"

DS9> set frame new
DS9> set X

Creating custom REPL modes can be done with something like REPLMaker, so the questions would just be

  • How do we want to interface with the custom mode (i.e. what character to switch over (I used |), what color is the prompt, is there additional information we want to show?)
  • What commands can be used in this interface (I'm pretty sure we can just use macros and allow use of any commands, but it makes most sense to use this for connect, set, and maybe some others). Another idea I had is that the command line defaults to issuing set commands, that is, running DS9> frame new would just call set("frame new") with some special cases like connect would call the DS9.connect method.

If this sounds interesting, I'd like to slowly incorporate this into a PR. It is mostly just expression parsing, so we could create a macro system like ds9"frame new" which would include all the logic we need for the REPL.

@emmt
Copy link
Member

emmt commented Jan 4, 2021

I really like this. You may want to show the current DS9 frame number in the prompt (and perhaps the server address if there are several ones running).

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