Cygwin terminal prompt missing - shell

Previously, when launching the Cygwin terminal, a console will popup and the line will say:
username#PCName ~ then a blinking cursor after $.
Now a blank console appears and nothing is on the console screen but a blinking cursor...
The shortcut seem to be directing to the right path "C:\cygwin\bin\mintty.exe -i /Cygwin-Terminal.ico -" so I don't know what's going on.
How do I go about fixing this issue? Do I have to look into the Environment variables? If so what do I have to look for?
I'm running Windows XP Professional x86.

Try changing the shorcut to this:
C:\cygwin\bin\mintty /bin/env CHERE_INVOKING=1 /bin/bash -l

Since you say it starts up successfully using cmd, it could a problem starting up you mintty environment. Try going into your home directory and deleting (back it up somewhere else if you want to be able to bring it back) the .minttyrc file and then try to start up again.
If that doesn't do the trick, try to go a little bigger and do the same with the bash environment files. Back up .bashrc, .bash_profile, .bash_aliases (if you have it) and .inputrc and replace them with the default sample files that are in the /etc/skel folder, then try to restart again.

Related

Its possible to change the "webstorm" shell command to open a file in WebStorm?

I open files in WebStorm from the terminal with the command webstorm . when I'm working in a directory.
Is there a way to change the command webstorm to anything more, like wstorm or something shorter to open files fluently?
I'm using macOS.
I Know one way but it's temporary, works untill you close the terminal.
-in your terminal
W=webstorm
then you can use $W in your command instead of webstorm.
Looks like the hint above is very good.
So assuming the shell script "webstorm" is working and your question is how to modify the command AND you want to do it fluently.
Make an alias (your shell may vary, mine is bash)
in the appropriate 'dot' file for your shell
add an alias for webstorm -e like this
alias we='webstorm -e'
now when I want to open a file quickly I type
we filename
And this opens Webstorm in LightEdit mode which opens faster and has a link to access full IDE.
Works like a charm. Also, you could make more than one alias so say ws for the full ide. Enjoy

Read only for open directories in vim

Then I open vim from terminal and open an directory like vim ., my starts in Read Only Mode.
I cant figure out why this happen and how I can change it.
If I start MacVim everything is fine. But then I start vim from the terminal and open a directory this screen comes. I can navigate one dir up and back again, and I have write access.
EDIT
I installed all my vim settings on Ubuntu 15.04. Now I can use
Does anybody know how to change this behaviour of vim?
Now I can use netw with the command vim . like I always used.
As you can see, there is no RO (read only) mark. How can
I have this in Mac on iTerm too?
What you see is exactly what you are supposed to see when doing $ vim .: the built-in netrw plugin displays a listing of the current directory that you can use to navigate your project.
If you don't want that listing, don't ask for it:
$ vim
or:
$ vim file
ctrl-p is not mapped by netrw; on my system, its set up by the yankring plugin. If vim is doing something other than going up one line, then you have a plugin involved. Try using :map to see what its mapped to; then do a search for that in your plugins directory.
The netrw way of opening a file in the same window is to use the <enter> key, although the g:netrw_browse_split variable may be used to change that default behavior.
Netrw opens in read-only mode, and that's not going to change. The file being opened should not be in read-only mode, however, if that's what you meant. If you're having a problem of that sort, please update your netrw; the most up-to-date version is at http://www.drchip.org/astronaut/vim/index.html#NETRW .
After I installed macvim 7.4 Every thing works!

Associate a file type with emacs/cygwin

I want to use Emacs as and editor and shell.
On Windows 7 I installed cygwin , X11 and emacs.
In terminal I added to /etc/profile file these lines:
XWin -multiwindow 2> /dev/null&
export DISPLAY=:0.0
sleep 1
emacs 2> /dev/null&
I created a shortcut that execute this command: C:\rhcygwin64\bin\mintty.exe -
Now every time I start that shortcut it starts emacs. No problem.
My goal is: associate some file types like .txt , .csv and etc with emacs in order when I start foo.txt it'll open in emacs.
When I tried to do it 'Set Associtation' control it accepts only file name and it does not take '-'. Hence when I try to open foo.txt it does not work. I tried to create a shortcut to mintty.exe but it didn't work either.
Could someone help me to create association in order to start to mintty.exe but rather mintty.exe - ?
Thanks in advance
I am taking my question off .
I realized that my problem is related to subshell issue ... when I try to invoke first cygwin, then emacs under it and etc.
I decided that I will not use much Windows Explorer but rather go directly to the file and open it. This way I don't need file association.
Please close my ticket.
Thanks

Anyone know how to put a Cygwin term in the context menu

I would like to put a Cygwin terminal menu item on a Windows 7 context menu.
But I would like the shell to open at the folder.
chere -i is supposed to do something like it but ends up giving a bash shell that does NOT have my profiles loaded.
Anyone know how to acheive this?
You can try chere -i -t mintty. It worked for me, as it defines which terminal type to bring up, and in my case, (I'm running 64 bit windows 7) mintty seems to load my profiles.
Since you have already tried chere -i, you have to uninstall it first, using chere -u, then run the above command chere -i -t mintty.
Bare in mind, that on my work laptop, I had to run cygwin as administrator for this to work (I believe chere modifies the registry at some point). But it worked on my home PC flawlessly without administrator privileges.
Other people also claim some success following this blog post, http://with-love-from-siberia.blogspot.co.uk/2013/12/cygwin-here.html which shows how to use a windows batch file to modify the registry to add the option to the folder context menu.

How to disable/remove Terminal script?

A while ago I wrote a Terminal script that executes cd Desktop every time I start Terminal.
With the release of Lion, this is no longer necessary as Terminal remembers where I last left off. I can't figure out how to disable/delete the script because I can't find it. There are also no options in the Terminal preferences that can help me. How do I disable or delete this script?
Probably controlled by one of the following files in your home directory, which you can edit/delete to remove this behavior:
.bashrc
.bash_profile
.profile

Resources