visual studio code is not launching in linux even though it is in the path - linux

visual studio code is not launching in linux even though it is in the path
I tried "code ." and expect to open the vscode for the current folder

export DISPLAY=:0 made my day
My Display was not set.It was unset while doing other debugging. reverting it make the window app launch from terminal.
DISPLAY is part of your linux serverx, usually the linux terminal doesn't support launching the window applications from terminal until the display is configured. so it is essential to make sure you have the right config for your DISPLAY arg for your serverx

Related

Where can I see a history of the commands i have ran in Terminal in Android Studio?

Android Studio has a tool window Terminal where you can write commands and have them executed.
Is there anywhere that the history of these commands (and there output) are saved so I can see the script that was executed? I thought the script would be saved on the local machine but I can't seem to find it.

Terminal resize issue with Intellij and Git for Windows SDK

I am on Windows running Intellij and Git for Windows SDK for a feature rich terminal on Windows (pacman, oh my zsh, etc...)
I looked up previously on which command to use to make it the default Intellij Terminal and SO delivered:
How can I launch git-for-windows SDK's git-bash in Windows Terminal?
I am using the cmd from above's 2nd post:
C:\git-sdk-64\msys2_shell.cmd -defterm -here -no-start -mingw64
Everything works fine except for a stubborn resizing issue :
Every time I resize the Intellij Terminal, the MSYS terminal stops receiving key strokes and I have to reopen a new one:
( can't type after the resize under the echo hello )
Trying to avoid WSL for now as I noticed maven builds through wsl were noticeably slower than directly on powershell or via git terminal.
Workaround
Not exactly a solution but if you run with MinGW32, the resize no longer causes the problem
To be seen if I will suffer from other 32/64 bit incompatibilities
using for now:
C:\git-sdk-64\msys2_shell.cmd -defterm -here -no-start -mingw32

Gradle exec PATH in Android Studio doesn't match command line

I'm running a Gradle script that needs to exec a few commands. (In my example, it's node.)
In my Terminal, node is on my PATH, so I can type node --version and it just works. My Gradle script works fine on the command line.
But when I try to run the Gradle build in Android Studio, it says:
> A problem occurred starting process 'command 'node''
Cause: error=2, No such file or directory
Unfortunately, the way this script runs on various machines, I can't be sure what the path to node will be; I need to use the PATH environment from the user's machine. (On macOS, node might be in /usr/local/bin or /opt/homebrew/bin or ~/n/bin or something else entirely.)
How do I make this work?
EDIT: To clarify, our developers will launch Android Studio via the OS launcher, e.g. by double-clicking it in Finder on macOS, or from the Start menu in Windows.
My hunch would be that the PATH in Android Studio depends on how Android Studio is started. If I start it from a Linux shell, then it uses the same PATH which is set in that shell. If you use an OS-specific launcher, then I suppose the PATH depends on what this launcher used – which may be different from the one that you set explicitly/implicitly for your shell (e.g., in a ~/.bashrc file).
I doubt that you can get this to work reliably without manually making sure on all user machines that the PATH is always set correctly for Android Studio – or that you manually make sure that all node installations end up on the “most system-wide” PATH that is available for each OS installation.

visual studio code remote integrated terminal not showing zsh theme

I use Remote SSH extension (from a Windows PC) to connect to a remote Linux Redhat host where all my development work happens. I use zsh as the default shell in VS code integrated terminal.
Here is the content of my .zshrc file:
export ZSH="/home/myname/.oh-my-zsh"
ln -s /home/myname/tools/dracula-theme-master $ZSH/themes/dracula.zsh-theme
SAVEHIST=10
HISTFILE=~/.zsh_history
ZSH_THEME="dracula"
source /home/myname/tools/zsh-syntax-highlighting-master/zsh-syntax-highlighting.zsh
I manually downloaded all the themes. Here is what I have under $ZSH/themes/:
And I have this line in my VS code settings.json:
"terminal.integrated.shell.linux": "/bin/zsh"
When I exectue
echo $TERM:
Everything seems to be set correctly. But the theme does not seem to display properly showing below:
But I am expecting something like this (e.g., showing current git branch, richer syntax highlighting):
Is it because VS code integrated terminal dose not support displaying the themes?

How to start windows program from WSL Ubuntu Xterm in foreground (on top of all other programs)?

I use git and invoke git difftool command from Xterm (that Xterm "runs" WSL shell). My difftool command is set up to start p4merge Windows application.
Everything works alright, but p4merge's window is displayed under all currently visible windows. Specifically, under the Xterm window that started it.
This drives me a bit nuts because if I need to diff 20 files, then I need to Alt+Tab 20 times manually.
I've just migrated from Cygwin to WSL and this exact setup started p4merge on top of all other windows in Cygwin.
So, how do I make WSL start a program and make sure that its window is topmost?

Resources