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

setup not adding IDEasy to current shell #810

Closed
hohwille opened this issue Nov 25, 2024 · 2 comments · Fixed by #811 or #819
Closed

setup not adding IDEasy to current shell #810

hohwille opened this issue Nov 25, 2024 · 2 comments · Fixed by #811 or #819
Assignees
Labels
bug Something isn't working

Comments

@hohwille
Copy link
Member

Expected behavior

As a IDEasy user, I want to use IDEasy immediately after calling the setup script so that I can start using the product immediately and do not get confused by errors.

Actual behavior

In case I open a shell and run setup script from there the first time and then call some ide command, it will say

ide: command not found

Since I just ran the setup, I would expect this to work immediately.

Steps to reproduce (bug) / Use Case of feature request (enhancement)

  1. ensure IDEasy is not yet installed
  2. download and unpack IDEasy as described
  3. open a shell (on Mac or Linux a bash) and cd to the _ide folder.
  4. run setup
  5. run ide help

Related/Dependent Issues

See also #779

Comments/Hints:

The setup script is registering ourselves to .bashrc but does not apply the changes to the current existing shell.
I would expect that the ide command (alias or function) also gets registered to the current shell.

Workaround: type bash to run a new bash shell inside the existing one and then type ide help and it will work.

Affected version:

  • 2024.12.001-beta-SNAPSHOT
@hohwille
Copy link
Member Author

I tried to fix this by adding the alias also to the current shell.
However, there is a drawback that we cannot solve:
Most users will run the script like this:

./setup

This will create a sub-process from the current terminal that has its own environment variables, aliases, functions, etc. while the users shell where he invoked the setup is the parent process that cannot be influenced by the sub-process by design of Unix/Posix standards.
The only way to make it work is instead calling this:

. setup

or in other words:

source setup

As telling all our users they must run the setup this way is kind of pointless and fighting against windmills, I now have to admit that we cannot properly fix this by design.
Therefore I will instead simply add a message to the end of the setup script telling the user, that he needs to open a new shell in order to make it work.
I may document that the setup script should ideally be sourced but I will not rely on it.
Whatever a user can do wrong will happen sooner or later.
The message is the only proper way to avoid confusion and make it work.
On the long run we will have a guided installer with UI and the problem will be gone anyhow since then nobody will manually create project and _ide folder, extract the release and run a setup script.
But for this our users need to be patient: we have a small team developing IDEasy and it is complex to implement installers for all major OS, bring IDEasy to marketplaces/app stores, etc.

hohwille added a commit that referenced this issue Nov 28, 2024
…rent shell #782: fix IDE_ROOT on linux/mac #774: fixed HTTP proxy support (#811)
@github-project-automation github-project-automation bot moved this from 🏗 In progress to ✅ Done in IDEasy board Nov 28, 2024
@hohwille
Copy link
Member Author

Was autoclosed by PR #811 - as explained above, I still need to add the according message.

@hohwille hohwille reopened this Nov 28, 2024
hohwille added a commit to hohwille/IDEasy that referenced this issue Nov 28, 2024
hohwille added a commit that referenced this issue Nov 28, 2024
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
Status: ✅ Done
1 participant