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

Proper support for user selected text editor on linux #259

Closed
ryanatball opened this issue Feb 24, 2016 · 0 comments
Closed

Proper support for user selected text editor on linux #259

ryanatball opened this issue Feb 24, 2016 · 0 comments
Assignees
Labels
Milestone

Comments

@ryanatball
Copy link
Member

@ryanatball ryanatball commented Feb 24, 2016

When prompted to "Open Exception Log in Text Editor", I always find that COSMOS tries to invoke gedit, which is not installed on my debian system. I expected it to use the EDITOR or VISUAL environment variable.

I tracked the problem down to the test for which gedit in /var/lib/gems/2.1.0/gems/cosmos-3.0.1/lib/cosmos/top_level.rb (the latest git version of top_level.rb has the same problem).

On my system, which gedit returns an empty string. Note that on debian, /bin/sh is a symlink to /bin/dash.

My workaround was to change the test from

if which_gedit =~ /Command not found/i or which_gedit =~ /no .* in/i

to simply

if which_gedit == ""

However, I think that the logic should be as follows:

if $VISUAL or $EDITOR exists
then
if xterm or gnome-terminal or rxvt or urxvt exists then
system_call = "TERMINAL -e $EDITOR filename"
else
system_call = "VISUAL filename"
endif
else try gedit

That is, EDITOR or VISUAL should take precedence over gedit. The use of VISUAL here assumes that it represents an X windows editor such as gedit.

@ryanatball ryanatball added the feature label Feb 24, 2016
@ryanatball ryanatball changed the title Proper support for user selected text edit on linux Proper support for user selected text editor on linux Feb 24, 2016
@ryanatball ryanatball self-assigned this May 5, 2016
@ryanatball ryanatball modified the milestone: v3.8.1 May 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.