Giter Club home page Giter Club logo

Comments (10)

gokul1099 avatar gokul1099 commented on September 21, 2024 1

Yes, We can incorporate an option in the preferences to allow users to select their default terminal. But for now, we can include a functionality that checks the user's preference. If a preferred terminal is set, the application will open that terminal; otherwise, it will default to the system's default terminal. As we introduce the ability to select the preferred terminal in the future, this functionality will seamlessly align with the new option and adapt accordingly.

from minisim.

okwasniewski avatar okwasniewski commented on September 21, 2024 1

Looks like NSWorkspace is commonly used to open terminal in a certain directory. Just by switching iTerm to Terminal we can achieve terminal opened in different directories. NSWorkspace.shared.openFile(filePath, withApplication: "iTerm")

However its not that simple to execute commands. Looks like apple script is the recommended way of doing so. What you could do is create a protocol something like a Terminal which would have open() method for each terminal: iTerm, Terminal, Hyper etc. that would run those apple scripts and that way we would have a clean architecture with a way of expanding to new ones.

from minisim.

gokul1099 avatar gokul1099 commented on September 21, 2024

@okwasniewski Shall I work on this

from minisim.

okwasniewski avatar okwasniewski commented on September 21, 2024

@gokul1099 Sure! Go ahead

from minisim.

gokul1099 avatar gokul1099 commented on September 21, 2024

@okwasniewski users preferred terminal means, whether the terminal the user set as default terminal or we have to ask the user to select the terminal they prefer to open the logcat

from minisim.

okwasniewski avatar okwasniewski commented on September 21, 2024

I would keep an option in Preferences with dropdown for iTerm.app, Terminal.app and others but I think we can implement it in the next iteration. So firstly let's implement this feature without it (keeping in mind that in the future we will change the terminal we are launching). What do you think?

from minisim.

gokul1099 avatar gokul1099 commented on September 21, 2024

@okwasniewski hey I need help on this. When I try to open the terminal and run the adb script for opening the logcat the terminal is opened but the adb command is not getting executed and terminal remain empty. I used shellout to with open command
try shellOut(to: "open -a (preferedTermial) --args bash -c(logcatCommand)")
I also tried using Process to execute this command even in that case terminal open up, but the add command is not getting executed. Do you have any idea on this ??

from minisim.

okwasniewski avatar okwasniewski commented on September 21, 2024

I think the easiest way to achieve this is with AppleScript:

osascript -e 'tell app "Terminal"
    do script "adb logcat -v color"
end tell'

Im not sure however how this would work for iTerm

from minisim.

gokul1099 avatar gokul1099 commented on September 21, 2024

I think the easiest way to achieve this is with AppleScript:

osascript -e 'tell app "Terminal"
    do script "adb logcat -v color"
end tell'

Im not sure however how this would work for iTerm

This is working for Terminal in case of iTerm the script should be like

tell application "Terminal"
	set newWindow to (create window with default profile)
	tell current session of newWindow
		write text "adb -s emulator-5554 logcat -v color"
	end tell
end tell

It is like different script for different terminal. Now I also trying this with NSWorkSpace.

from minisim.

gokul1099 avatar gokul1099 commented on September 21, 2024

@okwasniewski I have made one pull request please check

from minisim.

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.