# RHEL8(とそのクローン) の gnome-terminal は UTF-8 でしか起動しない

**URL:** <https://jlinuxer.org/t/topic/79>\
**Category:** ディストリビューション\
**Created:** [2023 年 6 月 18 日午前 9:07 UTC](https://jlinuxer.org/t/topic/79 "2023-06-18T09:07:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ninotchi](https://jlinuxer.org/user_avatar/jlinuxer.org/ninotchi/32/13_2.png) [@ninotchi](https://jlinuxer.org/u/ninotchi)\
**Post date:** [2023 年 6 月 18 日午前 9:07 UTC](https://jlinuxer.org/t/topic/79/1 "2023-06-18T09:07:38Z")

</div>

RHEL8(とそのクローン) も  
.bash\_profile とか .bashrc に  
export LANG=“ja\_JP.eucjp”  
と書くと gnome-terminal が起動できなくなる。

回避方法のメモ

.bashrc の最後に  
export LANG=“ja\_JP.eucjp”  
を追記

デフォルトの .bashrc は .bash\_profile の先頭で読み込むように書かれていた。  
この書き方だとログインセションでも bash は .bashrc を読み込む

なので、  
.bash\_profile の最後に  
if [“$XDG\_CURRENT\_DESKTOP” = “GNOME”] ; then  
  export LANG=“ja\_JP.UTF-8”  
fi  
を追記

そうするとログインセッションのGNOMEディスクトップで起動した  
gnome-terminal は ja\_JP.UTF-8 で起動するけど、  
その中で起動される bash は ja\_JP.eucjp となる。

su - hogehoge とか ssh localhost@hogehoge はログインセッションなので  
.bash\_profile を読み込むけど XDG\_CURRENT\_DESKTOP が無いので  
.bashrc に書いた ja\_JP.eucjp が設定される。

---

<div class="post-metadata">

**Author:** ![ninotchi](https://jlinuxer.org/user_avatar/jlinuxer.org/ninotchi/32/13_2.png) [@ninotchi](https://jlinuxer.org/u/ninotchi)\
**Post date:** [2023 年 6 月 20 日午後 1:26 UTC](https://jlinuxer.org/t/topic/79/2 "2023-06-20T13:26:18Z")

</div>

こっちのほうが良いかも

if [["$XDG\_CURRENT\_DESKTOP" == \*GNOME\*]] ; then
