-
Notifications
You must be signed in to change notification settings - Fork 13
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
Tcsh support #67
Tcsh support #67
Conversation
1. Rather than command -v, calling sh -c "command -v" works in both bash and tcsh 2. "2>&1" is bash-specific, but ">&" is recognized by both I also commented out the check for whether TMPDIR exists; that will also need to be handled in a shell-agnostic manner.
It doesn't appear to do anything, so we'll let everything run in user's default shell.
I added an extra step: check to see if TMPDIR is a defined environment variable (via printenv); if the variable exists, we then check to see if the directory exists by calling "cd".
Note that I left the |
self._jupyter_info(check_jupyter_status) | ||
if self.dir_exists('$TMPDIR'): | ||
if self.envvar_exists('TMPDIR') and self.dir_exists('$TMPDIR'): | ||
self.log_dir = '$TMPDIR' | ||
else: | ||
self.log_dir = '$HOME' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should double check to make sure $HOME
exists and is pointing to a directory too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If $HOME
does not exist, should we abort? I could do something like
if self.envvar_exists('TMPDIR') and self.dir_exists('$TMPDIR'):
self.log_dir = '$TMPDIR'
elif self.envvar_exists('HOME') and self.dir_exists('$HOME'):
self.log_dir = '$HOME'
else:
console.log(
'[bold red]Can not determine directory for log file'
)
sys.exit(1)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And if both $TMPDIR
and $HOME
are invalid, we should probably raise an error
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For a more informative error, we can be more verbose in Can not determine directory for log file'
by specifying that both $TMPDIR
and $HOME
were found to be undefined or pointing to non-existing directories....
Also added better log message in the event that neither $TMPDIR nor $HOME are available for creating .jupyter_forward/ (with no place for the log files to go, we expect jupyter-forward to abort)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your work on this, @mnlevy1981! This looks great and hopefully addresses other shell specific issues :)
Cecile H reported problems running jupyter forward, and @andersy005 tracked it down to a few
bash
commands that we were executing on the remote machine (she usestcsh
by default). We were able to get her running with some kludgy updates, but this PR cleans everything up.Testing: I created a VM where my default shell was
tcsh
, and verified that I could not usejupyter-forward
out of the box. After the following commits I was able to usejupyter-forward
to get to my virtual machine, and could still use it to connect to machines where my default shell isbash
.Fixes #66