Characters disappearing in cygwin terminal - terminal

In Windows, in both the Windows Terminal and cygwin's own terminal, sometimes with things like sftp and interactive php, some characters are 'disappearing' -- see the screenshot. This doesn't occur in a WSL2 session on the same machine, nor if I ssh to a Linux machine on my network, but does if I ssh to another Windows machine and invoke e.g. php -a inside a cygwin shell. So I'm guessing it's a cygwin problem, but what? (TERM is set to xterm-256color)
This is how it looks (correctly) within WSL:

Related

How to force opening of a separate window in an Unix script?

I have a small UNIX script that I want to open via double commander ( https://doublecmd.sourceforge.io/ ):
#!/bin/bash
sudo sshfs pi#192.168.178.23:/ ~/mount-pi/data -o reconnect -o allow_other
This script mounts a remote file system in a dedicated directory of my local machine.
When this script gets executed from a bash (and not from double commander), I get asked for the sudo passwords of both machines.
The graphical user interface of double commander allows me to execute the script via a double click, but the script seems to fail silently as no passwords are supplied.
How do I have to modify this script that it gets executed in another bash when clicking on it so that I can supply both passwords in that bash?
Remark:
I use Ubuntu / Compiz / Unity, and I need this in a graphical environment.
If you want to get a terminal window in a graphical environment you have to run a terminal application.
Try something like
xterm -e 'sudo sshfs pi#192.168.178.23:/ ~/mount-pi/data -o reconnect -o allow_other'
There are other terminal applications. Choose the one you like or that fits your requirements.
Of course this will not work if you are not in a graphical environment, e.g. if you use a (virtual) console.

Alternatives to cmd.exe for Windows Subsystem for Linux

I started using Linux Subsystem for Windows, and it is Rad! But, it is running in a terminal which behaves like cmd.exe (yuk!). This carries with it everything I hate aobut cmd. e.g., copy & paste, window sizing, etc.
I don't know how in 2018, Microsoft has allowed this to still exist.
Here are some alternatives:
Alternative Windows shells, besides CMD.EXE?
How do I run Ubuntu, Linux Subsystem for Windows in an alternative command prompt?
Windows cmd is really poor compared to the gnome-terminal or any other *nix-based terminals. Gets really messed up with Linux fonts. Try hyper terminal.
https://medium.com/#ssharizal/hyper-js-oh-my-zsh-as-ubuntu-on-windows-wsl-terminal-8bf577cdbd97

Is it not possible to use Windows Bash as shell in Emacs for ssh etc?

I tried but get error: Process shell exited abnormally with code 255.
Mainly want this for SSH, and avoid Cygwin or plink/Putty.
I have this in config:
(setq explicit-shell-file-name "C:\\Windows\\System32\\bash.exe")
(setq explicit-bash.exe-args '("--noediting" "--login" "-i"))
(setenv "SHELL" shell-file-name)
(add-hook 'comint-output-filter-functions 'comint-strip-ctrl-m)
Thank you
I use Bash for Windows with the latest Windows Creator's Update and Ubuntu 16.04 they have included. It runs quite well on Visual Studio Code and Cmder (a shell app like MobaXTerm etc). I also use ZSH instead of Bash (with oh-my-zsh and powerline9k) but i had some adjustments to do (and, it takes time to load, but i've read somewhere that Microsoft is working to fix this slow issue).
To be honest, it's a good way to replace Putty, but it has to grow a little. There's a lot of network tools that can't work on WSL for example.
I know the pain to prepare a Cygwin or use Putty, but you can take a look on MobaXterm, a really good ssh client that includes a package manager to allow you to do a lot of things from your Windows. I don't know if they use Cygwin like in the past ... But it's a ready-to-use solution with local bash shell.
To finish this and maybe help you, here is my startup line to run WSL / Bash for Windows in Cmder: bash -l -i -cur_console:p -c zsh. If you need any more information just ask :).

How to open remote shell in Emacs

I was wondering if one can open shell of machines accessible by ssh. If I do M-x remote shell, I am taken to the shell on the current machine. In my case, I run emacs over windows XP and therefore it takes me to shell of windows
Let me know if ssh.el works for you?

Launching server emacs from shell

I'm in a class that uses an implementation of Emacs on a school server. I'm on a mac running snow leopard, and I have my own implementation of Emacs on it. To access the server-Emacs, I ssh into the server and launch Emacs from its location there.
I'm relativly new to emacs, and I have a particular problem whenever I try to access the server-emacs from my local-emacs' shell-mode, having ssh'd into the server. It gives me the error that "Screen size -1x80 is too small", and doesn't launch the server-emacs.
I've the separate issue that when I try to do this in Apple's terminal, it does launch the server-emacs, but I really, really dislike the interface when emacs is launched within a terminal.
I've tried a couple of times to launch the server-emacs within a new window, in both scenarios, but apparently I'm not doing it right.
I think it'd be useful to understand what you're trying to do.
Do you just want to edit files on the server? If that's the case, read the documentation for tramp, and try:
C-x C-f //user#server:/path/to/file
If you really want to use the emacs running on the server, try creating a frame on your
(if so, look up tramp) If you want to actually use the emacs from the server, but have the window display on your mac:
ssh server
setenv DISPLAY mymac:0
emacsclient file &
This does assume you're running X11, and know how to resolve the display for your Mac. You can get X11 for the Mac here.
It's a bit hard to tell what you are doing, but you probably want to ssh to the server with an X tunnel, then run emacs there which will pop up the window on your mac.
First, don't use Terminal.
On your mac, start up X11 (google for XQuartz if you don't already have it).
Start up an XTerm (it should do this by default). From that XTerm, ssh to your server with the -Y option:
ssh -Y me#server.something
This should get you a remote shell and setup the DISPLAY environment to tunnel right back to your Mac's X server. Test it by running an xterm from there. If that works, you can instead run emacs. If that works, you can combine it with the ssh invocation:
ssh -Y me#server.something /usr/bin/emacs # or whatever path you need
You should set up ssh to not require a password but that's more than you asked for.
I think that Trey Jackson's suggestion of tramp (or the more old-fashioned 'ange-ftp) is probably your best bet.
In general, running emacs inside an emacs is never a good idea. You either want to run emacs on the server (in -nw mode inside the terminal, or via some $DISPLAY magic) or run it on your mac (via tramp). There isn't really a good way to do both.

Resources