wbond / sublime_terminal

Launch terminals from the current file or the root project folder
https://packagecontrol.io/packages/Terminal
MIT License
600 stars 117 forks source link

Terminal can not be opened at deepin 15.4.1 #182

Closed jianglin-wu closed 6 years ago

jianglin-wu commented 6 years ago

Env: deepin 15.4.1 sublime text 3

Terminal-setting: { "terminal": "deepin-terminal" }

Right click “Open terminal here...” or press “ctrl+shift+t/ctrl+shift+alt+t” button still unable to run terminal, Try restarting the application and system。 Use the "Ctrl + `" button to open the controller view, no mistake.

Open the "sublime-text-3/packages/Termical/Terminal.py" file, add the "print" method to the 170 row of the file, then run "open terminal here...", print "args", "cmd" and "env" value.

args: ['deepin-terminal'] cmd: /home/jianglin-wu/.config/sublime-text-3/Packages/Terminal env: { "GDMSESSION": "deepin", "GPG_AGENT_INFO": "/run/user/1000/gnupg/S.gpg-agent:0:1", "XDG_SEAT_PATH": "/org/freedesktop/DisplayManager/Seat0", "XDG_SESSION_PATH": "/org/freedesktop/DisplayManager/Session0", "XDG_SESSION_TYPE": "x11", "SHLVL": "1", "NODE_PATH": "/home/jianglin-wu/nodejs:/home/jianglin-wu/nodejs/lib/node_modules", "LD_PRELOAD": "/opt/sublime_text_3/libsublime-imfix.so", "QT4_IM_MODULE": "fcitx", "GIO_LAUNCHED_DESKTOP_FILE_PID": "1251", "USER": "jianglin-wu", "PATH": "/home/jianglin-wu/nodejs/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games", "PWD": "/home/jianglin-wu", "XDG_RUNTIME_DIR": "/run/user/1000", "XDG_SESSION_DESKTOP": "deepin", "XDG_CURRENT_DESKTOP": "Deepin", "CLUTTER_IM_MODULE": "xim", "DISPLAY": ":0", "GIO_LAUNCHED_DESKTOP_FILE": "/usr/share/applications/sublime-text-dev.desktop", "XMODIFIERS": "@im=fcitx", "QTACCESSIBILITY": "1", "": "/opt/sublime_text_3/sublime_text", "SHELL": "/bin/bash", "GNOME_DESKTOP_SESSION_ID": "this-is-deprecated", "XDG_SESSION_ID": "2", "DBUS_SESSION_BUS_ADDRESS": "unix:abstract=/tmp/dbus-qgnQb9IxIp,guid=f2eaa435c61ce4cb25fe308d5a252088", "LANGUAGE": "zh_CN", "HOME": "/home/jianglin-wu", "XDG_GREETER_DATA_DIR": "/var/lib/lightdm/data/jianglin-wu", "QT_LINUX_ACCESSIBILITY_ALWAYS_ON": "1", "SSH_AGENT_PID": "720", "QT_IM_MODULE": "fcitx", "LOGNAME": "jianglin-wu", "XAUTHORITY": "/home/jianglin-wu/.Xauthority", "LANG": "zh_CN.UTF-8", "XDG_SEAT": "seat0", "SSH_AUTH_SOCK": "/tmp/ssh-LxqeyPAYzUis/agent.638", "_JAVA_OPTIONS": " -Dawt.useSystemAAFontSettings=gasp", "XDG_VTNR": "7", "DESKTOP_SESSION": "deepin", "GTK_IM_MODULE": "fcitx" }

The application has never been wrongly reported, nor can it run.

twolfson commented 6 years ago

What's the error message you're receiving?

jianglin-wu commented 6 years ago

The plugin runs without error information, executes "subprocess.Popen (args, cwd=cwd, env=env)" and does not open the terminal window.

twolfson commented 6 years ago

Hmm, so normally if the terminal can't be found, then we get a pop-up like this:

selection_521

Since you're not receiving that, it sounds like the executable is being found but not doing anything. What happens when you try to run deepin-terminal from another terminal (e.g. gnome-terminal)?

jianglin-wu commented 6 years ago

I can successfully open a new terminal window by entering "deepin-terminal" or "xterm" on the command line. But the use of sublime terminal plugins to open "deepin-terminal" and "xterm" has not been a success. I run on another computer, and it doesn't appear window either. I run "gnome-terminal", which prompts me to "Terminal: The terminal gnome-terminal was not found". Does this plug-in support the Deepin system?

twolfson commented 6 years ago

Hmm, very strange. Maybe there's an environment variable set in Sublime Text which is causing this strange behavior (e.g. DISPLAY)?

I'd suggest opening a Python shell inside of xterm, dumping env, and diff-ing that with Sublime Text 3's output

We should support Deepin or any system for that matter as we run Popen which runs an executable against the kernel like any other process

jianglin-wu commented 6 years ago

The following is my solution:

  1. Install xterm terminal
    $ sudo apt-get install xterm
  2. Change Terminal.sublime-setting configuration to "terminal": "xterm"
    {
    "terminal": "xterm"
    }
  3. Edit /etc/X11/app-defaults/XTerm file, Beautify terminal styles.
    
    xterm.locale:true
    xterm.utf8: true
    xterm*utf8Title:true
    xterm*fontMenu*fontdefault*Label:Default
    xterm*faceName:Consolas:antialias=true:pixelsize=15
    xterm*faceNameDoublesize:WenQuanYi Micro Hei Mono:pixelsize=15:antialias=true
    xterm*xftAntialias:true
    xterm*cjkWidth:false
    xterm*background:black
    xterm*foreground:green
    xterm*color0: #000000
    xterm*color1: #CC0000
    xterm*color2: #4E9A06
    xterm*color3: #C4A000
    xterm*color4: #3465A4
    xterm*color5: #75507B
    xterm*color6: #06989A
    xterm*color7: #D3D7CF
    xterm*color8: #555753
    xterm*color9: #EF2929
    xterm*color10: #8AE234
    xterm*color11: #FCE94F
    xterm*color12: #729FCF
    xterm*color13: #AD7FA8
    xterm*color14: #34E2E2
    xterm*color15: #EEEEEC

!xtermeightBitInput:false !xtermaltSendsEscape:true



Perfect solution ^_^
twolfson commented 6 years ago

Glad to hear this was resolved =) Closing issue