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

init: Start shell only with TTY #768

Merged
merged 2 commits into from
Jul 16, 2020
Merged

init: Start shell only with TTY #768

merged 2 commits into from
Jul 16, 2020

Conversation

wenzeslaus
Copy link
Member

@wenzeslaus wenzeslaus commented Jul 3, 2020

Start the (sub-)shell only when running in an interactive terminal (TTY).
Without checking this, the start fails in contexts when terminal is not available,
for example, running command from Alt+F2 dialog on many Linux distributions.
The same situation can be created using the nohup command.

A failure to retrieve shell PID from gisenv is no longer considered an error
for cases when shell was not started.

The interactive shell can be forced regadless of the TTY by using --text in the command line.

This solves Trac ticket 3295 (GRASS GIS fails to start without terminal).

@wenzeslaus wenzeslaus added the bug Something isn't working label Jul 3, 2020
@wenzeslaus
Copy link
Member Author

This will needs to be rebased and merged after #722 is in.

@wenzeslaus
Copy link
Member Author

There is actually no need to wait for #722 with a review of this.

(@hellik @nilason and others:) Test on Windows would be great (I'm actually not sure how what to test there, but perhaps just replacing grass.py from your installation would be enough). Test on macOS would be a nice bonus (it is expected to be the same as Linux).

@nilason
Copy link
Contributor

nilason commented Jul 7, 2020

I wasn't able to reproduce the failure, so I cannot say if much about the fix per se.
But the PR seems to work on mac, i.e. GRASS works as usual.

@wenzeslaus
Copy link
Member Author

I wasn't able to reproduce the failure, so I cannot say if much about the fix per se.
But the PR seems to work on mac, i.e. GRASS works as usual.

Thanks. That should be enough for macOS (I expect the same behavior as Linux).

@wenzeslaus
Copy link
Member Author

This will need to be rebased after #722 and #765 are in.

Copy link
Member

@HuidaeCho HuidaeCho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. I confirmed the startup issue without TTY in Linux, which this PR fixed.

Start the (sub-)shell only when running in an interactive terminal (TTY).
Without checking this, the start fails in contexts when terminal is not available,
for example, running command from Alt+F2 dialog on many Linux distributions.
The same situation can be created using the nohup command.

A failure to retrieve shell PID from gisenv is no longer considered an error
for cases when shell was not started.

The interactive shell can be forced regadless of the TTY by using --text in the command line.
@wenzeslaus wenzeslaus merged commit 171db2e into OSGeo:master Jul 16, 2020
@wenzeslaus wenzeslaus added this to In progress in Shells via automation Sep 12, 2020
@wenzeslaus wenzeslaus moved this from In progress to Done in Shells Sep 12, 2020
@neteler neteler added this to the 8.0.0 milestone Dec 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Shells
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

4 participants