gnachman / iterm2-website

Website for iTerm2
http://iterm2.com/
GNU General Public License v2.0
80 stars 66 forks source link

tcsh shell integration $loginsh #70

Closed kenodegard closed 4 years ago

kenodegard commented 4 years ago

It seems misleading to rely on $loginsh to determine whether to run the shell integration script

https://github.com/gnachman/iterm2-website/blob/6acd1b77207148dc123103fc955c9c4a660157ba/source/misc/tcsh_startup.in#L7

since $loginsh is exclusively set when a shell is invoked as tcsh -l. Consequently, this results in the interactive sub-shells to not enable shell integration.

As such it would appear more appropriate to check for the $prompt which is set for all interactive shells - not just the login shell:

https://unix.stackexchange.com/a/26686

gnachman commented 4 years ago

Hm, this suggests that it also should be in .tcshrc and not .login. And for that matter, the bash shell integration script ought to use .bashrc (it already has a correct check for interactive shells).

The easiest solution is to update the installer. Some folks will wind up sourcing it twice, but the second one will have no effect.

I fixed the tcsh script in commit 02a1a889

kenodegard commented 4 years ago

Perfect!