IntelliJ IDEA Terminal Special Characters - windows

I recently started using IntelliJ IDEA Ultimate on Windows 10 and would really like to use the integrated terminal.
However, I can't get it to work with special characters like german umlauts or something like §.
That wouldn't be a problem if i hadn't some folders starting with Ü which i can't rename because they are part of a version control repo.
Because of that, i can't cd into these folders.
For example, an "ü" keystroke shows as "3R" and a "§" keystroke shows as "?" (like most special chars).
It neither works with the default terminal setting (cmd.exe) nor with git bash.
Has someone encountered a similar problem / has a solution for that?

I have had similar issues with IntelliJ Ultimate on Windows 10, regarding language and encoding on the Git Bash integrated Terminal. It was solved by setting the environment variables for the integrated terminal with the correct language. It can be done as follows:
Go to Settings
Terminal
Environment variables
Set two variables: LC_ALL=YOUR_LANGUAGE.utf8;LANG="$LC_ALL", where YOUR_LANGUAGE is the language code for the desired language. I searched a little and I think the correct one for German Umlauts is: de_DE.utf8. So, the configuration line would be:
- LC_ALL=de_DE.utf8;LANG="$LC_ALL"

Maybe you can set the file encoding by adding
-Dfile.encoding=UTF-8
to the idea64.vmoptions configuration file.

Related

How to setup SBT from bash from IntelliJ IDEA to avoid formatting characters being broken?

When running on Windows, I have changed my default terminal in the IntelliJ IDE from default Windows cmd to bash (I am using the one installed with Git, located at C:\Program Files\Git\bin\bash.exe). It works very well, the only trouble is that when running sbt from the terminal, some strange characters are shown (I assume they are some control characters intended to format the output).
This does not happen when I run sbt directly from the bash launched in the Windows as a standalone window.
Is there some setting (an environment variable or a config file) for any of the three components involved (sbt, IntelliJ, bash) I could change so that I do not see those formatting characters misinterpreted? If they would work and affect the formatting it would be a nice bonus, but that is less important to me.
IntelliJ:
Standalone:
sbt by default colors the console output, which does not work on Windows, but perhaps the launcher script doesn't disable the codes in the IntelliJ terminal script.
You can disable colors by passing the -Dsbt.log.noformat=true to sbt
You can preserve the colours and formatting if you add the following to your .bashrc file:
sbt() {
/c/progra~2/sbt/bin/sbt.bat "$#"
}
export -f sbt
.bashrc can be found (or created) in your %USERPROFILE% directory, e.g. C:\Users\{username}\.bashrc.
Substitute a different path to sbt.bat if necessary, but it needs to be without spaces.
Restart your terminal afterwards, or run source ~/.bashrc.
This exports a bash function that causes "sbt" to run the sbt batch file launcher instead of the shell script launcher that it would otherwise. The batch launcher clearly does a better job of processing the output on Windows. (I also use this for gcloud and gsutil commands that fall over in other ways when invoked from Bash.)
Find the sbtopts file (Windows location is C:\Program Files (x86)\sbt\conf by default) and make sure it contains following line and it is not commented out:
-no-colors

Fish shell on windows outputs question mark before each prompt

I just switched to a windows machine and I'm trying to get fish configured correctly. I installed it through the default route, as a shell selected through cygwin setup. It seems to be working fine, but when I directly access fish.exe or run fish.exe through IntelliJ, it outputs a ? before very prompt:
I googled and found this on fish documentation FAQ:
I'm seeing weird output before each prompt when using screen. What's wrong?
Quick answer:
Run the following command in fish:
echo 'function fish_title;end' > ~/.config/fish/config.fish
Problem solved!
The long answer:
Fish is trying to set the titlebar message of your terminal. While
screen itself supports this feature, your terminal does not.
Unfortunately, when the underlying terminal doesn't support setting
the titlebar, screen simply passes through the escape codes and text
to the underlying terminal instead of ignoring them. It is impossible
detect and resolve this problem from inside fish since fish has no way
of knowing what the underlying terminal type is. For now, the only way
to fix this is to unset the titlebar message, as suggested above.
Note that fish has a default titlebar message, which will be used if
the fish_title function is undefined. So simply unsetting the
fish_title function will not work
So it appears that intelliJ and cmd (fish.exe runs in cmd.exe if you access it directly) do not support setting the title bar, so they just output the character to the terminal instead. However, their suggested solution does not work. I've tried various options like echoing an empty string or a space, but nothing gets rid of that darn question mark.
Has anyone else run into this and found a solution?
Notes:
It doesn't have this behavior when using fish through mintty.exe,
most likely since that terminal supports setting the title, but I really prefer
to use the terminal inside intelliJ instead of having it in a
separate window.
It didn't have this problem when I used fish through IntelliJ on Ubuntu or MacOSX, it appears to be isolated to Windows

zsh tab completion messes up command line formatting

I'm running zsh with oh-my-zsh on OS X. Every time I use zsh's awesome tab-completion, formatting on the current command line prompt gets really screwed up. For example:
I'll be typing cd fo and try to tab-complete for the 'foo' directory; zsh prompts for completion but changes the command line to cd fo cd fo while it's waiting for me to complete. It's not a big deal but very annoying. Any suggestions?
I had the same issue on PopOS and Arch linux. I tried a bunch of solutions from various places but the only solution that worked for me was this suggestion by romkatv on an issue on the oh-my-zsh github repository.
The solution is to make a copy of the .zsh-theme file of whatever theme you're using in oh-my-zsh and surround all non-ASCII characters (like emojis) with %{%G<CHARACTER>%}
For example, the default oh-my-zsh theme robbyrussel contains 2 non-ASCII characters. The '➜' character in the prompt
PROMPT="%(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ )"
and the '✗' character in the prompt for git directories
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[yellow]%}✗"
Using %{%G<character>%} around the 2 non-ASCII characters like this
PROMPT="%(?:%{$fg_bold[green]%}%{%G➜%} :%{$fg_bold[red]%}%{%G➜%} )"
and this
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[yellow]%}%{%G✗%}"
solved the issue for me.
I have faced the same problem before, my solution was disabling some zsh plugins. The second probability is that your colour theme may contain a bug which causing this.
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
plugins=(git)
This is the final version of my plugin section in the ~/.zshrc file. Any other plugin between parenthesis may be the reason of your situation.
If your problem still continues you need to post your ~/.zshrc to let us check what is in there.
I had the same issue. Interestingly, I saw the problem only iterm2 while the prompt is correctly displayed in the standard terminal of OS X (after reverse-i-search/tab-completion). The reason seems to be that iterm2 defaults to Unicode (UTF-8) default encoding, which however is not correctly interpreted if the corresponding language variable is not set in the shell.
Solution: add the following to your .zshrc
export LC_ALL=en_US.UTF-8
The prompts will be displayed correctly.

Ruby display unicode character

I'm trying to print out some Unicode characters:
# encoding: utf-8
puts "ử ậ ắ ặ ố ồ"
If I run it through Powershell, this is what I get:
If I run it through cmd, this is what I get:
If I run it in Eclipse (with Aptana Studio 3 plugin), this is what I get:
Is it a problem with my system/software or is it Ruby's problem? How can I get it to work?
It works on Ideone though: http://ideone.com/PdycKH
Ruby supports it no problem, and setting the formatting at the top of the file is the way to go.
The issue is the display via the command line window. You need to use both a font and character page that supports Unicode display.
See this question regarding doing this in the Windows command line.
About the chcp command
I figured it out:
For cmd and Powershell, I have to change the font (I changed to Consolas)
In Eclipse, I have to change the encoding: go to Run/Run configurations, select the Common tab, change the Encoding to Other: UTF-8

Can't get all characters displayed in vim

I can't get certain characters, like ’ and ‘, to display properly in vim. They show up like <?>#~X. They work fine on SnowLeopard, but not on Ubuntu 10.10. The vim config is mirrored on the two systems, and contains:
set fileencoding=utf-8
set encoding=utf-8
set termencoding=utf-8
The ’ ‘ signs work in my terminal on ubuntu. Vim on ubuntu is version 7.3 p112, Vim on osx is 7.2 p108.
Any suggestions?
Am I missing anything in my config?
tx,
-aktiv
I have tried an unchanged vim on Ubuntu 10.04 and both of ticks are displayed as expected. The version I have tried was 7.2.330. If it helps, I can try 10.10 later, too.
Some remarks to track the problem down:
Debian/Ubuntu is completely UTF-8 based/aware for some time now. So there is no need to set it on your own, but it should not hurt, too.
For example the back tick (`) is an ASCII character and should "always" be available. It is an important character, e.g. for Shell or Perl programming.
So I do not expect that you are missing something in your configuration. Quite the opposite:
Perhaps you have added something in your configuration that treats the back tick special, e.g. tries to change the color or something like that.
So I would like to suggest, that you remove your custom configuration from the system and tries if the ticks and other characters are working. If this is the case you can add some of the configurations again. At some point the ticks should stop working. Then you have a small number of customizations that make these ugly characters.

Resources