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

[question] Alternitives to general terminal output? (Python, Interpreter, Scite, Linux) #1731

Closed
MvGulik opened this issue Dec 30, 2017 · 21 comments
Labels

Comments

@MvGulik
Copy link

MvGulik commented Dec 30, 2017

I'm a general long term Scite user (no expert though).
OS: Linux! (Mint) ... (with very limited Linux skills)

Geany looks nice, attractive and useful, but the way the Python(interpreter) output is displayed (terminal) is stopping me from actually using it. I guess I'm just to used to the Scite's output (display and feature wise).

  1. Are there any option available that I could try to get the Python output in a more Scite-output-pane look?
  2. Just in case. Might it even be possible, to 'somehow' use Scite itself for displaying the output?
    (both automatically, copy and pasting is of course out)

(With a bit of tinkering I already made Geany to show Python code like its displayed in Scite, to make it more like I'm used to (to lessen the color culture shock so to speak (joke))

@elextr
Copy link
Member

elextr commented Dec 30, 2017

Referring to other tools without describing/showing what they do is expecting other people to install a tool they don't use, just to respond to your request. It would make a response more likely if you provided that information.

@codebrainz
Copy link
Member

I don't know how Scite output looks, but Geany lets you run your scripts in an external terminal or into the built-in terminal (in the bottom area). There's also a plugin for Geany called GeanyPy that gives an in-process Python interpreter so you can poke around at Geany's guts from a built-in console.

@MvGulik
Copy link
Author

MvGulik commented Dec 30, 2017

@elextr : Here you go.
image

@codebrainz : I'll take a look at GeanyPy. But I'm doubtful I can pull off writing a Geany plug-in.

Screenshot/Output pane features:
Low pane is the output pane, which might look a bit to colorful to some. Remember its just an example to show off the optional colors you can give lines (trigger is the leading line character).
In addition there are some "backlink to code" lines, that, when double-clicked, jump back to the related code line in the related file (see yellow line and yellow dot)
Also kinda nice, new py-runs don't destroy the previous output. If needed you can look back at the previous output's (if setup that way).

@elextr
Copy link
Member

elextr commented Dec 31, 2017

Geany looks nice, attractive and useful, but the way the Python(interpreter) output is displayed (terminal) is stopping me from actually using it. I guess I'm just to used to the Scite's output (display and feature wise).

Geany distinguishes between running tools (eg compilers) from running user programs.

Tool output is scanned for messages referring to the source code and those lines are highlighted and made clickable in the compiler tab and the user has no ability to interact with the tool (since that is how most tools work, and so nobody has added such a capability).

But output from the user programs is displayed in a terminal because that is where they will normally expect to be run (at least if they are command line tools) and that makes user interaction possible.

As @codebrainz said programs can be run in the embedded terminal or external terminals, but its still a terminal, obeying the TERMCAP specs and matching where such a program would normally be run and meaning that if the program outputs colour information that will be shown.

So your Python output looks like it will when Python is run on the command line.

Are there any option available that I could try to get the Python output in a more Scite-output-pane look?

No, Scite seems to be applying its own colouration to it, ie it isn't behaving as a terminal. That would need somebody to write a plugin that behaved in that way as its unlikely to be added to core.

Just in case. Might it even be possible, to 'somehow' use Scite itself for displaying the output?
(both automatically, copy and pasting is of course out)

The capability is not in Geany itself, and the GUI toolkit we use (GTK) has deprecated the facility for doing that, so although somebody could make a plugin to do it, it will go away at some point in the future.

@MvGulik
Copy link
Author

MvGulik commented Dec 31, 2017

I guess in that case I don't even have to try then.

(Closing)


Some hours later ...
image
Not perfect, but just as I expected.

@MvGulik MvGulik closed this as completed Dec 31, 2017
@MvGulik
Copy link
Author

MvGulik commented Apr 23, 2018

If you code, you make mistakes.
And if you code you probably also regularly print() stuff to pre-check for potential mishaps. (well ..., I do)

Its really to bad that SciTE (the Scintilla showcase editor, with Geany seemingly being based on Scintilla) has such a nice terminal/output/code_result_feedback feature ... compared to Geany.

Sure you can't make everyone happy, but ... now a days I think a little more user friendliness in the part that handles the coding feedback ... goose a long way. (turns out to be a showstopper in my case, ... of course.)

As I have used SciTE for, probably, more than a decade. I'm probably a little bit biased here ... (But at least I know I might be, unlike some current world ... leaders(???) ... and there followers/supporters of course.)

@codebrainz
Copy link
Member

And if you code you probably also regularly print() stuff to pre-check for potential mishaps. (well ..., I do)

Geany doesn't prevent you from print()-ing, I do it all the time and look at the result in the embedded terminal.

Its really to bad that SciTE (the Scintilla showcase editor, with Geany seemingly being based on Scintilla) has such a nice terminal/output/code_result_feedback feature ... compared to Geany.

The same way how SciTE got this feature, Geany could get it. There are no features in Geany which someone spent time coding but didn't want/need. All functionality comes from people seeing a need or wanting a feature and then contributing it.

@MvGulik
Copy link
Author

MvGulik commented Apr 24, 2018

Geany doesn't prevent you from print()-ing

I did not say you could not print() output with Geany.

The same way how SciTE got this feature, Geany could get it.

Based on elextr last comment, I seriously doubt that.

There are no features in Geany which someone spent time coding but didn't want/need. All functionality comes from people seeing a need or wanting a feature and then contributing it.

That's some weird argumentation if you ask me ... sound to me your trying to say:
"If its not there ... it must be not 'that' useful. As any (and all) Geany user that felt the want/need for it could and would have coded/added it to Geany"
... If only things were 'that' simple ...

@elextr
Copy link
Member

elextr commented Apr 24, 2018

The same way how SciTE got this feature, Geany could get it.

Based on elextr last comment, I seriously doubt that.

I said you could make a plugin to do it, but you likely could not "use Scite itself".

Several plugins add a new tab to the message window. But the plugin would have to run the command and intercept the output itself and apply colouring, and as plugins can be C++ you might even be able to use some of Scite's code for the colouring.

That's some weird argumentation if you ask me ... sound to me your trying to say:

What he is saying is that Geany is an entirely volunteer project, nothing exists in Geany unless somebody wanted/needed it and contributed it. There are no paid staff to implement requests. If it doesn't exist nobody who was capable of contributing it wanted/needed it (or at least wanted/needed it enough to spend their own time on contributing it).

@b4n
Copy link
Member

b4n commented Apr 24, 2018

That's some weird argumentation if you ask me ... sound to me your trying to say:
"If its not there ... it must be not 'that' useful. As any (and all) Geany user that felt the want/need for it could and would have coded/added it to Geany"

No, what @codebrainz is saying is that if it's not there it's 99% of the time because nobody wrote the code, usually because they didn't want the feature bad enough to step up and do it.
His statement is not 100% correct as I e.g. myself have occasionally worked on features I didn't want for myself, but as Geany is not run by a big team and is all volunteer effort, most of the time new features come from the people that wrote the actual code. The more active team members will often work on some feature that was proposed a user and that they liked, but most of the time features that "core developers" don't particularly fancy need the contribution from the user(s).
We try our best to review proposals and code (although lately we're lacking manpower with time on their hands, I for example can unfortunately only allocate a little bit of time for Geany ATM), so if someone comes with an implementation we'll try and review it and integrate it if we think it's good. Criteria for "good" include not interfering with other features, robust and conforming code, and for big features sometimes that it couldn't be implemented as a plugin just as well.

@MvGulik
Copy link
Author

MvGulik commented Apr 25, 2018

Focusing on my core Geany problem. (ie: understanding for sure if its actual possible what I have in mind)

( @elextr )... so although somebody could make a plugin to do it, it will go away at some point in the future.

So the "it will go away" part was completely, and only, related to doing some linkup (output or otherwise) with SciTe from Geany ...

But the plugin would have to run the command and intercept the output itself and apply colouring, ...

Makes sense.
Could a potential plugin like that also be able to facilitate active links in its output/tab/message window (based on python's error messages) that, when clicking on such a link, puts the cursor+focus back at a specific line in a specific file ?

... and as plugins can be C++ you might even be able to use some of Scite's code for the colouring.

Doubtful ... considering my almost total lack of C related experience, and Niel's expert code level. Besides, my first priority is knowing if a 'proof of concept' is actual feasible (no point in trying if you think its not even feasible). Next would be to get some 'proof of concept' working ...

@elextr
Copy link
Member

elextr commented Apr 25, 2018 via email

@codebrainz
Copy link
Member

So the "it will go away" part was completely, and only, related to doing some linkup (output or otherwise) with SciTe from Geany ..

Specifically, it was related to embedding SciTE's GtkWindow inside a GtkWidget in Geany (ie. XEmbed). Even though it's deprecated in GTK+ it's still technically possible with Xlib, but it seems like a terrible idea anyway :)

Next would be to get some 'proof of concept' working ...

It should be pretty straightforward to whip together a protoype plugin in Python. You could probably use subprocess.communicate() or whatever the current thing is, and after processing the results, stuff them into a Gtk.TreeView in the bottom notebook similar to the compiler tab.

@MvGulik
Copy link
Author

MvGulik commented Apr 26, 2018

... embedding SciTE's GtkWindow inside a GtkWidget in Geany

Aha. That part, as general Linux noob, bypassed me completely.

It should be pretty straightforward to whip together a protoype plugin in Python. You could probably use subprocess.communicate() or whatever the current thing is, and after processing the results, stuff them into a Gtk.TreeView in the bottom notebook similar to the compiler tab.

This looks more like something I could potentially do. Or at least spend some time in trying to work out.
Thanks (both).

@MvGulik
Copy link
Author

MvGulik commented May 13, 2018

This looks more like something I could potentially do. Or at least spend some time in trying to work out.

To bad, but that's not going to happen any time soon ...

It took me some time to look again into how to get GeanyPy installed ... but could not make any sense of it. I'm not into building code with lots of dependencies ... final trigger was some "probably not going to work with py3" note (py3 only coder). In my case that means a 100% probability I'm going to run into a slew of mystifying (to me) errors an problems, without the means/knowledge to solve them.
Ergo: No thanks, I'll pass ... Putting Geany back into the (local) bottle.

@elextr
Copy link
Member

elextr commented May 13, 2018

@MvGulik an alternative method of running Python plugins is here

@elextr
Copy link
Member

elextr commented May 13, 2018

(and it works with Python 3)

@codebrainz
Copy link
Member

@elextr that has even more build dependencies and less distro binary packaging.

@MvGulik
Copy link
Author

MvGulik commented May 14, 2018

Peasy: Thanks @elextr, but I take @codebrainz words on this as 'not really something for me to try'. Besides I rather would use GeanyPy in this case, as its kinda coming from the same team/team-member as Geany.

I might give it an other try in due time ... but for now Eric/Eric6 is back into focus (after managing to update it. ... ... ... seems a general Mint's packets habit, kinda outdated app versions. :-/ )

@codebrainz
Copy link
Member

I didn't mean to dissuade anyone from using Peasy, it will almost surely replace GeanyPy sooner or later, and is also developed by a member of the Geany team. But if compiling GeanyPy from source is too much hassle, Peasy, if anything, will be slightly more involved to compile, and AFAIK isn't packaged for most distros where you can use that to drag in the build dependencies.

@MvGulik
Copy link
Author

MvGulik commented Nov 2, 2019

(codebrainz in other topic) The built-in terminal does support ANSI escape sequences.

Something I probably should try with Geany in the future ... now that I'm starting to use them with some other editor/ide.

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

No branches or pull requests

4 participants