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

sh emulation in setup.zsh breaks my zsh config #686

Closed
de-vri-es opened this issue Oct 20, 2014 · 6 comments
Closed

sh emulation in setup.zsh breaks my zsh config #686

de-vri-es opened this issue Oct 20, 2014 · 6 comments

Comments

@de-vri-es
Copy link
Contributor

The emulate sh in setup.zsh breaks something in my zsh config. I think it's something in my prompt since I get an error message at every prompt. I haven't pinpointed the problem though because I have a rather large configuration, and removing the emulate sh fixed the problem for me.

Is there a reason for the emulate sh? If there is I can dig and find out what exactly is conflicting, but it seems likely than most sh code will work without modification in zsh, without having zsh emulate sh.

@dirk-thomas
Copy link
Member

emulate sh is currently required since otherwise the called sh code will not work correctly in zsh. E.g. zsh does not honor the IFS which is used in for loops.

Since it reset the emulate mode afterwards (a301219) I don't see how that would conflict with your zsh configuration. It might be worth to track down what exactly conflicts for you since it can't be changed in catkin easily.

@de-vri-es
Copy link
Contributor Author

Alright, I will dig to find the exact problem and try to provide a minimal broken zshrc.

@de-vri-es
Copy link
Contributor Author

I found the problem. Either emulate sh or emulate zsh enables the nomatch option which I specifically disabled in my zshrc. Although I can plate around this specific issue, it is not nice to change options someone set in their zshrc or to require that setup.zsh is sourced before you set your own options.

emulate -L sh inside a function is truly temporary and doesn't affect global options. So this would be much nicer:

_catkin_source_setup() {
    emulate -L sh
    source "$_CATKIN_SETUP_DIR/setup.sh"
}
_catkin_source_setup

@dirk-thomas
Copy link
Member

It looks like we were depending on emulate sh before but as of a0d699a we are not using the IFS anymore. So removing the emulate lines should work fine.

I created a new PR for it: #692
@de-vri-es Thank you for your effort - you were right in the first place - just removing the emulate lines still works.

@de-vri-es
Copy link
Contributor Author

Awesome, thanks.

@Ram-Z
Copy link
Contributor

Ram-Z commented Jan 22, 2015

This breaks it for my setup. I have the zsh option noclobber set which doesn't allow truncating a file when redirecting to it.

/opt/ros/indigo/setup.sh:52: file exists: /tmp/setup.sh.ksO4Uv1fen
Failed to run '"/opt/ros/indigo/_setup_util.py" ': return code 1

PR following.

Ram-Z added a commit to Ram-Z/catkin that referenced this issue Jan 22, 2015
Ram-Z added a commit to Ram-Z/catkin that referenced this issue Jan 22, 2015
Ram-Z added a commit to Ram-Z/catkin that referenced this issue Jan 22, 2015
dirk-thomas added a commit that referenced this issue Jan 26, 2015
source in emulation mode  (really fix #686)
cwecht pushed a commit to cwecht/catkin that referenced this issue Mar 20, 2018
Follow change cartographer-project/cartographer#839 from string to struct SensorId.
Compute expected sensor ids for multiple trajectories.
Remove command argument input for sensor ids.
Make some methods const.
Clean up.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants