I am working on an Android App and just start to use Cygwin for ndk-build. When I build my c lib, the output may disappear while scrolling down fast. The same will happen when I try to make other libraries based on Linux through Cygwin. Although I can reopen the cmd window and make the project again to see the output that really matters, such as, warnings, errors, but it's really annoying to do it again and again.
Does someone encounter the same question? How to solve it?
Thanks.
What terminal are you using? By default cygwin just runs bash under the usual windows cmd.exe, which is definitely not all that great; installing and using mintty (simplest way to do so is through cygwin's setup.exe) and setting the scrollback buffer size to accommodate your needs should fix the problem.
You could use other terminals too- PuTTY, xterm, rxvt, etc (even the KDE and Gnome terminals are available through Cygwin Ports)- but mintty is probably the best option for most cygwin users' needs (it's rather simple, small, and fast, and it integrates well with Windows).
Another option would be to redirect compilation messages: use > to redirect stdout to a file, overwriting it if it already exists, >> to append, and add a & if you want both stdout and stderr redirected, e.g. gcc mysource.c &>compilelog.
Related
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.
I want to disable cygwin temporarily without uninstalling it (e.g. for the duration of a batch script).
I was hoping there is a simple way, e.g. an environment variable like
$> SET cygwin=OFF
or an internal cygwin command like
$> cygset off
Right now I am using a quick and dirty solution that simply invalidates the cygwin directory in the Windows path with
SET PATH=%PATH:Cygwin=%
Of course this will also corrupt other pathes that have Cygwin in it.
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.
I'm on a fresh Virtualbox install of CentOS 6.4.
After installing zsh 5.0.2 from source using ./configure --prefix=/usr && make && make install and setting it as the shell with chsh -s /usr/bin/zsh, everything is good.
Then some time after, after installing python it seems, it starts acting strange.
Happens with PuTTY and iTerm2 over SSH, does not happen on the raw terminal through Virtualbox.
typing something, then erasing it: rather than removing the char and moving the cursor back, the cursor moves forward.
Typing Ctrl+V then Backspace repeatedly prints out this repeating pattern '^#?'
Running cat from zsh works fine. Prints out '^H' if I type that, backspaces like normal if I type normal backspace.
Surely someone's seen this before and knows exactly what the hell it is.
I'm not positive yet, but it seems that installing oh-my-zsh can fix this. But I really want to know what the specific issue is here.
OK , I suggest you try
export TERM=xterm
in your .zshrc configuration
the Changing into Zsh caused the bug.
sigh I knew I solved this before.
It's too damn easy to forget things.
The solution is to compile and apply the proper terminfo data with tic, as I have a custom config with my terminal clients, xterm-256color-italic, that confuses zsh.
There appear to be other ways to configure this stuff too; I basically just need it to be properly set up so italics work everywhere (including in tmux) so hopefully I can figure out how to do this more portably than I am currently.
I encounter the same problem when I manually install ZSH without root, when the backspace turns to blankspace but still functions as Backspace. Finally, I find it is because "ncurses" is not installed well.
tic: error while loading shared libraries: libncurses.so.6: cannot open shared object file: No such file or directory
? tic could not build /home/user/ceph-data/soft/ncurses-6.1/share/terminfo
After I reinstall the "ncurses", the problem of ZSH backspace is solved. Just for your information.
my $TERM is xterm-256color, by the way.
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.