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

.bashrc Not Loading on App Startup in a-shell #889

Open
iach526526 opened this issue Feb 4, 2025 · 3 comments
Open

.bashrc Not Loading on App Startup in a-shell #889

iach526526 opened this issue Feb 4, 2025 · 3 comments

Comments

@iach526526
Copy link

Hello,

According to the a-shell documentation, when I open the app, it should load .bashrc and .profile. However, it seems that .bashrc is not being read initially, which causes the jp command to be invalid. After enter and exiting the Dash shell, a-shell appears to load .bashrc and recognizes it, allowing the jp command to work.

image

image

@holzschu
Copy link
Owner

holzschu commented Feb 4, 2025

Hi,
thanks for reaching out. I looked again at the source code, and I can guarantee that both .bashrc and .profile are loaded when you start the app. However, they're loaded as part of the initialization system, in an asynchronous way (the system continues running, creating the window and initializing things while they're being executed. That's to avoid blocking the app). It seems you were too fast with your first command. dash doesn't look at the .bashrc, by design.

@iach526526
Copy link
Author

Got it! But how can I execute command like ls ,cowsay command when app start? Currently, I can only execute cowsay automatically in .profile when I enter the dash shell.

@holzschu
Copy link
Owner

holzschu commented Feb 7, 2025

These commands are executed, but their output is not redirected to the main window, because they are executed while the main window and its output are still in the process of being created. It's a design choice so that under-powered devices can still have a working window in a reasonable amount of time.

If you really need a command that shows its output when the app starts, then the best idea is probably to use a key feature of the app: if dash was running when the app went into the background, and if the relevant setting is setted (it's on by default), then the app will restart dash when it restarts. dash has a more classical behaviour, and it will definitely print the output of all commands on the main screen.

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

2 participants