GithubHelp home page GithubHelp logo

Comments (3)

matthewsedam avatar matthewsedam commented on June 10, 2024

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.

jonmarkprice avatar jonmarkprice commented on June 10, 2024

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.

matthewsedam avatar matthewsedam commented on June 10, 2024

I agree.

from betty.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.