cygwin/X version 1.17 xinit version 1.3.* breaks run.exe - cygwin

i have been using cygwin/X for many years and have not had any major problems, until the upgrade of xinit to version 1.3.x, it breaks everything without any warning at all. people wonder why open source gets such a bad reputation, it's this kind of blindsiding that does it...
anyway, prior to xinit 1.3.x i started Xwin via the Xwin icon. i could then start xterm (or emacs or any X application) using run.exe which i would pin to the taskbar. my command line is as such:
D:\cygwin\bin\run.exe -p /bin bash ~/scripts/xterm.sh
my xterm.sh is as follows:
export DISPLAY=127.0.0.1:0.0
xterm &
exit
this has worked like a charm for YEARS, now it doesn't do anything.
even doing this in a windows cmd:
set DISPLAY=127.0.0.1:0.0
d:\cygwin\bin\run.exe -p /usr/X11R6/bin xterm
doesn't work anymore...
does anyone know how to start an Xwin application (xterm, emacs ...) via the dos command line ...

Try to set DISPLAY to :0.0 (not 127.0.0.1:0.0). Source.

Related

Git bash, using VIM 8.1 on Windows :Term command. Node REPL not working correctly

I'm working on a corporate network (windows pc) with little access to tools like tmux, cmder etc.. however after recent update to git bash, we have access to Vim v8.1 which has a terminal built in.
I can load up vim and the type :term to load up a terminal... it works for standard terminal operations such as ls or git push etc.. but when you run node it seems to crash. And it doesn't render the node repl prompt.
Anyone know how I can get this working? (As predicted it works on the mac)... this is really useful to test out an algorithm quickly without leaving vim.
I also tried just typing !node to execute outside of vim and this has the same effect.
Any clues would be much appreciated.
Many thanks
Kevin
I figured it out...
You just type node -i for interactive (This isn't needed on the vim 8.1 on the mac)

Using tmux through Cygwin: "open terminal failed: not a terminal"

I'm trying to use tmux on a Windows Computer. I successfully installed tmux using
apt-cyg install tmux
I can confirm successful installation because I get the following:
$ tmux -V
tmux 2.3
However, when I try to type "tmux" in the console, I get the following error:
open terminal failed: not a terminal
Any thoughts?
It sounds like the terminal you're using doesn't support full tty emulation. Clients like mintty (comes with Cygwin---or should, anyway), putty, rxvt for Windows, &c. will handle that. CMD, ConEmu, and Cmder won't.
There's not much to be done here without a huge ordeal (See second comment: https://news.ycombinator.com/item?id=8577817). Unsatisfying though it may be, the best answer is to make sure you're running mintty. CYGWIN.bat should run it out of the box, so if that's not working, try running it directly from Explorer instead of from CMD. Otherwise, you might need to poke around in the batch file and make sure C:\Cygwin64\bin\mintty (or what have you) is being called.

virtual terminals in ubuntu server do not recognize newly installed nvm

Ubuntu server (as all linuxes) has the ability to multitask using ctrl-F1 up to ctrl-F7. Each of these key combos puts you in another terminal. While in the main terminal (ctrl-F1) I installed nvm (node version manager) and also node.js. These work fine in the ctrl-F1 terminal. But when I go to another terminal, ubuntu thinks they are not installed. ECHO $PATH gives the same result in all virtual terminals. Default programs like nano, vim, etc can be started in all the different terminals. How can I 'fix' this issue so that I can run learnyounode in one terminal, nano in another terminal, and node in another terminal?
If you have shells running on those terminals which were initiated before you ran the installer, they will not have received the updated configuration. Log out and then back in, or figure out which configuration file(s) to source anew. Probably
. ~/.bashrc
but there could be pertinent changes in .bash_profile and/or .profile as well (and system config files, if you did a system-wide install).

Cygwin Terminal shell stopped working properly

cygwin64 had been running great on my Windows 7 system for several months. After rebooting this morning, it appeared to be inexplicably broken. When I started a new mintty session, rather than presenting a window with my familiar bash prompt, I got a blank window entitled -sh.exe. Sure enough, despite the lack of any sort of prompt, it was a shell window. ls, pwd, cd, and other commands worked, but my environment was a mess. Aside from the lack of a prompt, my home directory, path, and other things were messed up.
I tried the normal things. I reran cygwin setup to no avail. I completely uninstalled and reinstalled cygwin, again with no discernible effect. I rebooted a number of times during all these tries. What could cause cygwin to suddenly begin behaving so badly?
I had similar issues after installing IBM InfoSphere DataStage, which causes Cygwin to misbehave because it is setting several Windows environment that are inherited by Cygwin, and are crucial to Mintty and the shell. These variables are: SHELL, TERM, TERMCAP, and TERMINFO.
I modified my Mintty shortcut to contain the following target, and this fixed the issues:
C:\cygwin\bin\mintty.exe /bin/env -u SHELL -u TERMCAP -u TERMINFO - TERM=xterm-256color HOME=/home/username /bin/bash -i -l
The -u options are unsetting those variables, and then I'm explicitly setting TERM and HOME (make sure to use your home directory instead of /home/username).
I also had to copy my ~/.minttyrc file to /etc/minttyrc so that mintty would see it.
After digging around, I noticed that the sh.exe that was running was not in /cygwin64/bin, but was instead in \Program Files (x86)\MKS Toolkit. I did not recall installing MKS, but the date on this directory was from the previous day. The only thing I'd recently installed was the IBM InfoSphere DataStage client. It turns out, InfoSphere not only installs the MKS Toolkit, it prepends it to a number of environment variables, totally hosing cygwin.

What has happened to startx on Cygwin?

I just had my desktop computer replaced. Both my previous computer and this one have Windows XP. In order to work with the many Linux servers we have, I installed Cygwin along with its xterm package. However, I cannot run startx to start the X-window server as I did with my previous computer. I've been looking online to see why startx is missing from my install, but I haven't found anything yet. Any help would be greatly appreciated.
[Does more research] Well, I just installed the xinit package, which I do not recall having to do before. (It may have been a requirement for the xterm package the last time I installed Cygwin.) startx now exists, but I wouldn't say it works. The X-window server it starts creates a window that covers my entire monitor with three terminals within it, unlike the old 25 line x 80 column single terminal window I'm used to. Worse, I can't just spawn child windows like I used to, which was the real power of using Cygwin with X-windows.
OK, after doing more research and getting help from one of my coworkers, I have found a solution to my problem.
What has happened is that, although startx exists, it now starts the X server in fullscreen mode by default instead of multiwindow mode. Looking back, I probably could have copied /etc/X11/xinit/xinitrc to ~/.xinitrc and customized it. However, it turns out that there are other startup scripts for the X server which are easier to modify. (See http://x.cygwin.com/docs/ug/using.html.)
In this case, I took the script startxwin.bat. I then made a couple of changes to startxwin.bat:
I added a drive letter to the CYGWIN_ROOT because my work environment has my home directory outside of the C drive.
I added a "+tb" option to the xterm call to suppress the menubar at the top of the X-window.
The nifty thing is that by going to Start → Programs → Cygwin-X → Xwin Server, I can open a GUI Cygwin X-window without ever opening the standard Cygwin command line. This was decidedly not the case with my previous installation.
I should add that I made these changes after expanding my selection of packages. Instead of just installing X11 → xterm, I followed the recommendations in step 15 of http://x.cygwin.com/docs/ug/setup-cygwin-x-installing.html and installed:
X11 → X-start-menu-icons
X11 → xinit
X11 → xorg-docs
X11 → xorg-server
(This selection picked up X11 → xterm as a required package.) While I see no obvious reason why the directions above wouldn't have worked with just X11 → xterm and X11 → xinit installed, I haven't put that theory to the test, and I have little desire to blow away my current installation and rebuild it to prove my theory.
I hope this helps other people avoid some pain.
Disclaimer: I know this answer does not answer your question directly, but it offers a good alternative.
I use Cygwin + XMing to run remote X applications:
Launch XMing
Start my favorite Cygwin shell (zsh)
export DISPLAY=localhost:0
ssh -X myserver.domain
Run X programs
Works like a charm. The best part is that XMing can neatly integrate X windows into the Windows GUI, i.e. each X app has its own full-right window.
Thanks, this helped me a bit (finding out about installing xinit). That new startx window was really crappy, a friend helped me solve it in another way: by starting with: startxwin.sh instead of startx. Then it looked like the "old" one, and worked much better.
When you installed Cygwin, did you install the full package set? The default is to only install a baseline of packages which may not include X.
Run setup.exe again and ensure the X11 packages are installed. I just click on the little double arrows next to "All" until it says "Install". It may be you chose "Default" instead.
It's better to have a full install since I remember having problems with Cygwin dependencies in the past and now, when I run 'Start', 'All Programs', 'CygWin-X', 'XWin Server', it runs fine, opening up one shell, then 'xterm &' opens another shell.
So I really think you need to install the lot. You could try, at a bare minimum, the whole X11 group (not just xinit) but you may as well do the lot, especially given the powerful commands you get.
I always run Cygwin install twice ... the first time, I just install default packages, and the second time, I install EVERYTHING. The download takes forever, but in this way I always have almost everything I could possibly want. (I like how on Cygwin I can install everything and there are no conflicts, unlike some Linux distributions where there are packages that do the same thing in different ways which can't be installed at the same time. But of course Cygwin has an easier job of this than a full OS ... there's no Cygwin sendmail, for example.)
I have to install Cygwin on a new machine tomorrow, so this question freaks me out. I'm going to die if startx isn't working. I hope it turns out that you're just missing a package. I highly recommend installing everything.

Resources