TCSH Shell Integration Fails from Quotations
Thanks for filing an issue! Please answer the questions below so I can help you.
- iTerm2 version: Build 3.2.6
- OS version: macOS com.googlecode.iterm2.plist10.14.2
- Attach ~/Library/Preferences/com.googlecode.iterm2.plist here (drag-drop from finder into this window)
Detailed steps to reproduce the problem:
- Connect to a remote host whose default shell is tcsh.
- Download shell integration using the menu bar.
- Wait for download to complete.
- Logout of the remote host.
- Log back into the remote host.
What happened:
The line source "${HOME}/.iterm2_shell_integration.tcsh"
encounters an error message: Unmatched ".
Using set echo
in .tcshrc
before .login
is executed points to the line:
set _iterm2_truncated_prompt=`echo "$prompt" | sed -e 's/ $//'`
as the culprit. Indeed, if I comment out the line in .login that runs shell integration, and just from a normal command prompt run > echo "$prompt" | sed -e 's/ $//'
I can recreate the Unmatched ".
error. Even running echo "$prompt"
fails with Unmatched "
.
For context, my prompt is set to:
> echo $prompt
%B%n%b@%U%m%u %S%/%s %#
The quick workaround for me is to change that line in the shell integration script from:
set _iterm2_truncated_prompt=`echo "$prompt" | sed -e 's/ $//'`
to
set _iterm2_truncated_prompt=`echo $prompt | sed -e 's/ $//'`
Once this is done, everything works as expected!
In case it's relevant, my tcsh version is:
> echo $version
tcsh 6.18.01 (Astron) 2012-02-14 (x86_64-unknown-linux) options wide,nls,dl,al,kan,rh,nd,color,filec
What should have happened:
iTerm2 Shell Integration for TCSH is executed on shell startup without any errors.