I get the following when trying to run gitk in cloud9-ide
application-specific initialization failed: no display name and no $DISPLAY environment variable
Error in startup script: no display name and no $DISPLAY environment variable
while executing
"load /usr/lib/x86_64-linux-gnu/libtk8.6.so Tk"
("package ifneeded Tk 8.6.1" script)
invoked from within
"package require Tk"
(file "/usr/bin/gitk" line 10)
gitk is a visual git tool and Cloud9 doesn't have a gui, only a terminal. So unfortunately they're not going to work together. You could try using tig, which is visual but works with the Cloud9 terminal.
If you have an ssh connection open in the background (like PUTTY) and you have XForwarding configured correctly on that connection. You can launch gitk from the cloud9 terminal.
Related
How can I run Gitk on WSL 2?
I already installed Gitk in WSL 2.
After I installed Gitk, I tried to run it but it failed with below error log:
application-specific initialization failed: no display name and no $DISPLAY environment variable
Error in startup script: no display name and no $DISPLAY environment variable
while executing
"load /usr/lib/x86_64-linux-gnu/libtk8.6.so Tk"
("package ifneeded Tk 8.6.8" script)
invoked from within
"package require Tk"
(file "/usr/bin/gitk" line 10)
Could you help me how can run Gitk on WSL 2?
You can install and run gitk straight from ubuntu terminal on Windows 11, using apt install.
I've just followed the steps from the following post and it worked:
https://learn.microsoft.com/en-us/windows/wsl/tutorials/gui-apps
I had to update not only the graphic driver but also the WSL.
Now, I can use either gitk or any linux app on Windows 11.
If git is installed on windows, you can find the gitk.exe by typing the following command to windows cmd:
where gitk
you can reach this folder from your wsl by changing the path e.g. from
C:\Git\cmd\gitk.exe
to
/mnt/c/Git/cmd/gitk.exe
and by typing this path to the terminal of your linux distribution, gitk can be opened.
UPDATE:
If you want to open gitk by typing it, you can add the path to ~/.bashrc with the following command (needed only once):
echo 'alias gitk="/mnt/c/Git/cmd/gitk.exe"' >> ~/.bashrc
And after that you can open gitk like:
gitk
I have simple File Watcher that run TSLint. If I copy the command and run it in the console all fine but WebStorm run it with old Node version and throw error Buffer.alloc is not a function.
I'm using nvm to manage node.js versions.
ubuntu 16.4
Different Node.js versions are on your $PATH when you start your script from the IDE and from terminal.
When being launched from desktop/System menu, WebStorm only sees environment variables configured in login shell, but not in interactive shell configuration files (like .bashrc or .zshrc).
Possible workarounds:
Workaround 1: make required variables available in a login shell by moving them to the corresponding shell profile config
Workaround 2: run IDE from a terminal, either with the command line launcher or with bin/webstorm.sh
Workaround 3: edit the desktop launcher and set command to /path/to/shell -l -i -c "/path/to/webstorm.sh" (make sure that the shell you specified there has the needed variables configured in its interactive shell configuration file)
see also https://youtrack.jetbrains.com/issue/IDEABKL-7589
I have created a python virtual environment using VS code editor.
a virtual environment is created successfully but I am not able to activate it.
when I am trying to activate my virtual env
I have also tried with "activate.bat"
I was trying to activate virtual env command in PowerShell which is by default selected in VS Code, that why it was giving me an error.
we can select different terminal(PowerShell, Command Prompt, Git bash) in VS code. so I have just selected cmd(Command Prompt) and now it is working.
You are using Powershell in your terminal (as denoted by PS) in the begining of every line in the terminal. You can switch to cmd and it will work. To do this, check the above asnwer by Sandeep Bhatt. If the option is not available, follow these steps,
Open commands search (use Ctrl+Shift+P or from menu View->Command Palette...) while terminal is open
In command box that appears, type "Terminal: Select Default Shell" and select it.
All the available commands which are in path will be listed. Select command prompt here.
Once this is done, you can change into cmd by clicking the plus icon shown here
You need to change the shell like here in the picture
change it to git bash or terminal of windows, and use the command "source FolderNameOfVirtualenviremenrts/Scripts/activate" (this command is for git-bash terminal)
Assuming that you're using powershell and your python virtual environment is in the 'venv' folder then you'll need to source the Activate.ps1 script by using the following command
. .\venv\Scripts\activate.ps1
The dot (.) is the equivalent of "source" command in powershell.
After sourcing Activate.ps1 the virtual environment commands activate and deactivate will work.
With newer versions of virtual environments (https://github.com/microsoft/vscode-python/issues/6931) you can also activate the environment as in the following example:
& .\venv\Scripts\Activate.ps1
This should work now if you are in powershell:
.\Venv/Scripts/Activate.ps1
It's unclear what you're using to create the virtual environment, and I presume that you're simply accessing the terminal from VSCode.
Try source activate <env_name> to start your environment.
I am attempting to install RetroPie as an app on Raspbian Stretch and I am done except for creating a desktop shortcut for it. The problem is that the only way to open RetroPie seems to be running a command in the command line. I can’t do it in terminal because it gives me an error saying that it can’t initialize the window. Is there a way to run a command line command as a shortcut or am I going to have to find another way of doing this?
P.S. Here is the tutorial that I followed to install RetroPie:
https://www.makeuseof.com/tag/install-retropie-app-raspberry-pi/
Probably your shell (on the raspberry) is GNU bash. So read the manual of GNU bash.
You probably want (once) to edit some Bash startup file (such as ~/.bashrc) to define functions and aliases there, and you could add executable shell scripts somewhere in your $PATH. I recommend having a $HOME/bin/ directory containing your scripts and executables, and have $HOME/bin/ early in your $PATH.
I can’t do it in terminal because it gives me an error saying that it can’t initialize the window.
Perhaps you need some display server (such as Xorg or Wayland) running (with a desktop environment or a window manager). You could run Xorg on your PC (on which you could install Linux) and connect to the raspberry using ssh -X then remote applications running on your Raspberry are displayed on your PC. IF your Raspberry is directly connected to a screen (via HDMI) you might run some Xorg server on it.
Is there a way to run a command line command as a shortcut
Yes, by making a shell alias or shell function or shell script. You need to understand how they work and change or create some appropriate file using some source code editor (I recommend GNU emacs, but the choice is yours and you might use any other editor such as vim, gedit, etc...): functions and aliases could be defined in your ~/.bashrc; shell scripts would usually have their own file with a shebang under your $HOME/bin/...
I install and run PWgui-6.2 in cygwin, and get this message
"couldn't load file "/usr/bin/tk86.dll": No such file or directory
while executing
"load /usr/bin/tk86.dll Tk"
("package ifneeded Tk 8.6.8" script)".
I guess the package tk-8.6.8 is lacked in cygwin so I try to add this package. However I can't find out this package from repository.
Could you help me to solve this problem?
The answer is here: Cannot launch git gui using cygwin on windows, and this is essentially a duplicate question. The problem is that
gitk and git gui require X11 in Cygwin.
Solution
Install some of the Cygwin X11 packages:
Run the Cygwin installer again.
Install "xinit" under the X11 category, accepting all the dependencies.
(Windows Start menu should now include: Cygwin-X)
Start menu > run XWin Server
In Cygwin shell, run
export DISPLAY=:0.0
At this point I got "Authorization required, but no authorization protocol specified", so to fix that set
enable_xauth=0 in \bin\startxwin
(Note:)
Will need to run XWin Server every time you reboot, and set export DISPLAY=:0.0 every time you open a new Cygwin shell. (Run echo "export DISPLAY=:0.0" >>~/.profile to have it run automatically whenever a new shell is started).
If you get couldn't connect to display ":0.0", mouse over the X that should be in Windows taskbar tray, the pop-up should say something like Cygwin/X Server:1.0. Use that ":1.0" (or similar) instead as the value for export DISPLAY.
Install windows Git.
Uninstall git from cygwin repo.
Set the environment Path for Git "C:\Program Files\Git\cmd" and move it above C:\cygwin64\bin