Can't open terminal in vscode on os x 10.11.6 - macos

Have installed VS Code (ver 1.27.2) on os x 10.11.6. All settings are still default values. When attempt to open the integrated terminal, a pane opens with usual headers, but no terminal prompt. Is this a known issue? Is there a fix?

At the top of the terminal window, on the left side, there are selectable options with the following name: Problems, Output, Debug Console, and Terminal. The terminal on my machine usually opens in the Output mode. This option is a window with nothing in it yet. If I click on the Terminal mode I get the regular looking terminal with prompt.

Related

Terminal prompt not working when opening DevContainer (OSX)

I am trying out the Remote - Containers VSCode extension. I get a docker warning and a prompt message if I want to continue but I can't type anything into the terminal. The cursor looks like it's active but nothing happens when I type.
So far I have tried:
Using iTerm.app instead of Terminal.app (in VSCode settings)
Disabled oh-my-zsh terminal plugin
Quit and start Visual Studio code
I solved this by using generating ssh key in the devcontainer and adding it to github.

iTerm as default terminal for Anaconda

I just installed Anaconda (with GUI) for data science projects. I'm a Mac user and when I launch Jupiter notebook from Anaconda Navigator it runs macOS default terminal. Is there a way to set Anaconda for using iTerm2 as terminal?
If you open iterm2 and go to the toolbar(on the top of the screen), try iTerm2-make iterm2 default term. See if this changes the behavior.
If not and you prefer using iTerm2, you can always open up an iTerm2 window and simply type
jupyter notebook
And you should have a jupyter notebook open in your browser, with the process running in the iTerm2 window.
Based on the default installation of anaconda (and iterm2).
Make sure, iTerm2 is an default term - this probably wont help, but... Do that :D
Open iTerm, navigate in menu on iTerm2 > Make iTerm2 default term
When you open the jupyter for example from anaconda, default terminal launches with the script. The name of this script file should be located at the top, by default it is: /opt/anaconda3/bin/jupyter_mac.command
Navigate to /opt/anaconda3/bin/ folder, or any other one where the command file from previous step is.
from terminal: open /opt/anaconda3/bin/ which will open finder in this destination)
In this folder, locate the jupyter_mac.command file
CMD+I on this file (or right-click and select Get Info)
This will open Information window for this file. Under the accordion, there is a selection of "Open with".
Instead of terminal, select iTerm2
Ideally, click on Change All... button so all the .command files will launch in iTerm

How to open a window from mac terminal

this is the first time I ask on stackoverflow because I can't find the answer anywhere. I use emacs to write all my code and I just switched from ubuntu to mac os. One problem has been bothering me: How could you open emacs window from mac terminal just like you would open firefox window from terminal on Linux system? I know the way it works for Linux system is that, whenever you type a command from terminal, the terminal search for the binary in you PATH and execute it. Is it the case for Mac that you can only open applicaiton in window form under "/Application" directory and all binaries opened from terminal are in non-window form? Big thanks!!
The pre-installed Emacs that comes with OS X is built without the GUI. Hence
$ emacs # in the shell/terminal
will NOT open a graphical window, and instead will open up the text/terminal version instead. Note that this version (installed at /usr/bin/emacs) is also old, and is at 22.1.1 in Mountain Lion.
To get the behavior you desire (and also get the latest version of Emacs as a bonus), you can download the latest Emacs build. This is available at various places, including http://emacsforosx.com/.
Most of these pre-built Emacs are installed under /Applications, and in order to invoke from the terminal, you will need to specify the full path to the binary, which usually is:
/Applications/Emacs.app/Contents/MacOS/Emacs
You can create a simple alias to this binary in your .bashrc as:
alias emacs=/Applications/Emacs.app/Contents/MacOS/Emacs
and then invoke emacs in its full glory from the command line.
I just tried
/Applications/Utilities/Terminal.app/Contents/MacOS/Terminal &
and it did open a new window just fine.
OS X 10.7.4 here.
EDIT: Indeed if I try:
open /Applications/Utilities/Terminal.app
No new terminal window is opened
But,
open --new /Applications/Utilities/Terminal.app
works also, and is probably better than my first option because the job is not tied to the terminal you started the new terminal with.
First, download a Mac OS/X emacs build from here: http://emacsformacosx.com/
Second, once it's installed, you can:
Open it from the command line with open -a emacs
Set it to run server mode in your .emacs init, and then at the
command line type emacsclient foo for file foo.
I'd recommend either getting emacs via fink, or going to here: http://emacsformacosx.com/
This will allow you to install a local version of emacs that runs through the X server, and thus has the full GUI interface.
not sure if u're looking for something like this
open /path/to/some.app

How can I automatically run my programs in a Terminal window & debug with Xcode?

I am building a program on Mac OS that uses the curses library. When I attempt to run it inside Xcode, I get this error message:
Error opening terminal: unknown.
And then curses calls exit.
Obviously, it works from a Terminal window.
Is it possible to launch my program in a terminal window from Xcode? I know that I can use the "Wait for XXX to launch" option, but a lot of Xcode's helpfulness in starting programs vanishes that way, so I would be looking for another way.
Xcode uses GDB, or LLDB for debugging.
You can invoke them directly from a terminal. This way, your executable will be attached to a working one.
Try:
gdb path/to/my/executable
Then, from the GDB prompt, type:
run
To start your program in debugging mode.
Take a look at the GDB manual for learning stuff like debugging commands, breakpoints, etc.

How to get the output of an OS X application on the console, or to a file?

I am writing a Cocoa application with Mono embedded. I want to run and see my debug output in Terminal. On the Cocoa side I am using NSLog(), and on the Mono side I am using Debug.Write(). I can see my debug output in Xcode's console, but not in Terminal. This is what I tried:
$: open /path/build/Debug/MyProgram.app
$: open /path/build/Debug/MyProgram.app > output
$: open /path/build/Debug/MyProgram.app 2> output
in a terminal but I do not my output on the console or in 'ouput'.
What's the correct command?
PS. My ultimate goal is to write a vim plugin to manage, build, run, debug the xcode project. You can save me this hassle if you can get this vi input manager to work with xcode.
Chris gave a good overview of how the Console works, but to specifically answer your question: If you want to see the results directly in your Terminal, you need to run the built product as a child of the Terminal, which means using something like
/path/debug/build/MyProgram.app/Contents/MacOS/MyProgram
to launch the app.
Terminal on Mac OS X is just another application. Opening a terminal window for text I/O is not an inherent capability of every application as it is on Windows.
Furthermore, open /path/to/MyApp.app does not execute MyApp.app as a subprocess of your shell, it sends a message to the operating system's launch infrastructure asking it to execute the application in a normal fashion, the same as if it were double-clicked in the Finder or clicked in the Dock. That's why you're not able to just redirect its output to see what your app is sending to stdout or stderr.
You can use Console.app to see the output of applications launched in the normal manner, because the launch infrastructure specifically sends their stdout and stderr there. You can also use the asl routines to query the log, or perform more sophisticated logging if you so desire.
Open Console.app in /Applications/Utilities. All NSLog output will be printed in the System log.
Or, if you run it from within Xcode, all of the output will be printed in the Debug console.
I'm not on my Mac right now and don't recall the command sequence or the menu the Debug Console is in, possibly the Build menu?
Overview
The idea is to simply run the app from command line using ios-deploy.
Instructions
Install ios-deploy
Run the app from xcode (make sure it runs successfully)
go to xcode menu > preferences > locations and click on arrow in derived data:
in the derived data directory, search for your .app file under Build/intermediates/Products
in the terminal type the following
ios-deploy --debug --bundle
then drag the .app file from step 4 unto the terminal.. you should have something like this
ios-deploy --debug --bundle path/to/your/applicationName.app
and that's it! The app should successfully run and all the logs will go to your terminal.

Resources