Comments (3)
It appears that the command is executed, but it is executed in the betty process. So, if you execute "betty go home" in bash, for example, betty runs the command and changes the directory but the directory in the parent bash process is not changed as "cd ~" is not ran through bash. I do not believe there is a way around this as bash would have to listen for a signal from betty.
from betty.
I think the only way around this would be for betty to replace the parent process (i.e. the shell) with a new process. After executing cd ~
, we'd have to call exec bash
. However, not everyone uses bash, so we'd need to detect which shell they were using when they launched betty.
Something like this:
#!/usr/bin/ruby
parent = Process.ppid
shell = %x{ps -q #{parent} -o comm=}
exec("cd ~; exec #{shell}")
will open a new instance of the correct shell at the user's home directory, but it will still be running atop the old shell. Thus if you type 'exit', you will appear back in the old instance of bash, etc. Also if you click to close the console window it will warn you about running child processes.
The only way that I can think of to get around this would be to open a new terminal window (e.g. x-terminal-emulator
on Linux) but this will cause the new window animation to show up and will clear the screen and lose recent command history.
Thus I don't think there is a good solution to this problem without making betty a shell in its own right. So I think the "go home" functionality should be removed.
from betty.
I agree.
from betty.
Related Issues (20)
- Betty does not work with internet HOT 4
- Maintainer? HOT 1
- betty says "Couldn't get a file descriptor referring to the console" while using web queries
- Add a setting to change the weather from Fahrenheit to Celsius and vice versa HOT 1
- Problem with command "go crazy"
- Problem with command "whats my real name" HOT 1
- command not found stuff on arch HOT 1
- command not found stuff on arch HOT 6
- Additional git support HOT 2
- BETTY warning Insecure world writable after speak to me command
- install.rb copies the wrong files if not in correct directory
- Can you please add a command for multiple directory creation
- Make installation possible via RubyGems? HOT 1
- Error: no say in HOT 1
- $ betty give me permission to this directory - incorrect semantics.
- how can i run it? HOT 4
- zsh install problems? HOT 3
- If you could add Italian HOT 1
- Can anyone update this code? HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from betty.