Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Immediately broken after zsh integration #399

Closed
ldelossa opened this issue Dec 14, 2022 · 12 comments
Closed

Immediately broken after zsh integration #399

ldelossa opened this issue Dec 14, 2022 · 12 comments
Labels

Comments

@ldelossa
Copy link

ldelossa commented Dec 14, 2022

Hey there,

I'm playing with extraterm as it looks pretty cool.

I was trying to get it to work, but unfortunately, the application experiences an error immediately after sourcing the zsh integration.

This error does not allow for any further command to be ran, and completely locks up the terminal.

[TERM]  Unknown CSI code: %s (%s). q 113
[TERM] Unknown CSI code: %s (%s).,q,113
An exception was thrown while dispatching an event of type 'Timer':
TypeError: Cannot read property 'setParent' of null
  at Terminal.appendBlockFrame (/home/louis/Downloads/extratermqt-0.68.0-linux-x64/main/dist/main.cjs:128344:26)
  at Terminal.#handleApplicationModeBracketStart (/home/louis/Downloads/extratermqt-0.68.0-linux-x64/main/dist/main.cjs:128684:12)
  at Terminal.#handleApplicationModeEnd (/home/louis/Downloads/extratermqt-0.68.0-linux-x64/main/dist/main.cjs:128647:48)
  at _Emulator._processDataApplicationEnd (/home/louis/Downloads/extratermqt-0.68.0-linux-x64/main/dist/main.cjs:122240:55)
  at _Emulator._processWriteData (/home/louis/Downloads/extratermqt-0.68.0-linux-x64/main/dist/main.cjs:121625:28)
  at _Emulator._processOneWriteChunk (/home/louis/Downloads/extratermqt-0.68.0-linux-x64/main/dist/main.cjs:121497:39)
  at _Emulator._processWriteChunkRealTime (/home/louis/Downloads/extratermqt-0.68.0-linux-x64/main/dist/main.cjs:121471:16)
  at /home/louis/Downloads/extratermqt-0.68.0-linux-x64/main/dist/main.cjs:121442:14
  at EventEmitter.<anonymous> (/home/louis/Downloads/extratermqt-0.68.0-linux-x64/main/dist/main.cjs:126551:9)
  at EventEmitter.emit (node:events:394:28)
An exception was thrown while dispatching an event of type 'Timer':
TypeError: Cannot read property 'setParent' of null
  at Terminal.appendBlockFrame (/home/louis/Downloads/extratermqt-0.68.0-linux-x64/main/dist/main.cjs:128344:26)
  at Terminal.#handleApplicationModeBracketStart (/home/louis/Downloads/extratermqt-0.68.0-linux-x64/main/dist/main.cjs:128684:12)
  at Terminal.#handleApplicationModeEnd (/home/louis/Downloads/extratermqt-0.68.0-linux-x64/main/dist/main.cjs:128647:48)
  at _Emulator._processDataApplicationEnd (/home/louis/Downloads/extratermqt-0.68.0-linux-x64/main/dist/main.cjs:122240:55)
  at _Emulator._processWriteData (/home/louis/Downloads/extratermqt-0.68.0-linux-x64/main/dist/main.cjs:121625:28)
  at _Emulator._processOneWriteChunk (/home/louis/Downloads/extratermqt-0.68.0-linux-x64/main/dist/main.cjs:121497:39)
  at _Emulator._processWriteChunkRealTime (/home/louis/Downloads/extratermqt-0.68.0-linux-x64/main/dist/main.cjs:121471:16)
  at /home/louis/Downloads/extratermqt-0.68.0-linux-x64/main/dist/main.cjs:121442:14
  at EventEmitter.<anonymous> (/home/louis/Downloads/extratermqt-0.68.0-linux-x64/main/dist/main.cjs:126551:9)
  at EventEmitter.emit (node:events:394:28)

Extraterm - 0.68.0

I am on Fedora 36.

zsh --version
zsh 5.8.1 (x86_64-redhat-linux-gnu)

I source the commands file directly from the zsh.init, as the very first line.

ldelossa added a commit to ldelossa/extraterm that referenced this issue Dec 15, 2022
fixes: sedwards2009#399

As outlined in the above issue, a nil deref is always encountered with
attempting to call 'getBlock()' on the blockFrame instance in
Terminal.appendBlockFrame function.

Checking it, and only calling "setParent" seems to clear the issue from
my testing.

Blocks render correctly and the zsh integration now works.

Signed-off-by: Louis DeLosSantos <[email protected]>
@sedwards2009
Copy link
Owner

Does this happen when running from source (still)? It shouldn't be null of course. If it was a packaged build which was blowing up then it might have something to do with a packaging bug which caused the Tip to fail when a new terminal is started.

Also, which config file exactly did you modify? I want reproduce the problem here too.

Thanks for looking into this.

@ldelossa
Copy link
Author

Are you asking me to re-pull main and try?

@ldelossa
Copy link
Author

Hello,

I can no longer test because cd1e10e1dabaaf2d40a9e8129f4a217c3c93ceef broke the terminal's rendering in Sway all together.

This probably warrants opening a new ticket.

@ldelossa
Copy link
Author

ldelossa commented Dec 17, 2022

Okay, you helped me determine the above is actually not an issue.

However, I still experience the same issue with latest master...

image

I did not modify any config file, I simply try to source the zsh script in extraterm built from source.

@sedwards2009
Copy link
Owner

I think I can reproduce the problem now. There is also something clearly wrong in the code before the crash. It should put something inside the frame.

@ldelossa
Copy link
Author

Awesome :). Excited to use this!

@sedwards2009
Copy link
Owner

The bug seems to be gone now. I refactored a bunch of code related to the frames and terminal contents.

@ldelossa
Copy link
Author

ldelossa commented Dec 24, 2022

Hey there,

I pulled master, and did a yarn run clean && yarn run build && yarn run run - unfortunately the app now never spawns a UI window at all.

Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
2022-12-24 16:39:34.846 INFO [ConfigDatabase #0] Reading user configuration from /home/louis/.config/extratermqt/extraterm.json
2022-12-24 16:39:34.847 WARN [ConfigDatabase #0] Unable to find config for key  general
2022-12-24 16:39:34.848 WARN [ConfigDatabase #0] Unable to find config for key  command_line_action
2022-12-24 16:39:34.848 WARN [ConfigDatabase #0] Unable to find config for key  session
2022-12-24 16:39:34.848 INFO [main #0] Recording logs to  /home/louis/.config/extratermqt/extraterm.log
2022-12-24 16:39:34.896 INFO [main #0] User extension directory is: /home/louis/.config/extratermqt/extensions
2022-12-24 16:39:34.897 INFO [ExtensionManager #0] Scanning '/home/louis/git/ts/extraterm/extensions' for extensions.
2022-12-24 16:39:34.898 INFO [ExtensionManager #0] Read extension metadata from '/home/louis/git/ts/extraterm/extensions/About'.
2022-12-24 16:39:34.899 INFO [ExtensionManager #0] Read extension metadata from '/home/louis/git/ts/extraterm/extensions/Autocomplete'.
2022-12-24 16:39:34.900 INFO [ExtensionManager #0] Read extension metadata from '/home/louis/git/ts/extraterm/extensions/Autolink'.
2022-12-24 16:39:34.900 INFO [ExtensionManager #0] Read extension metadata from '/home/louis/git/ts/extraterm/extensions/Colorizer'.
2022-12-24 16:39:34.901 INFO [ExtensionManager #0] Read extension metadata from '/home/louis/git/ts/extraterm/extensions/CommunityTerminalThemes'.
2022-12-24 16:39:34.901 INFO [ExtensionManager #0] Read extension metadata from '/home/louis/git/ts/extraterm/extensions/CopyBlock'.
2022-12-24 16:39:34.902 INFO [ExtensionManager #0] Read extension metadata from '/home/louis/git/ts/extraterm/extensions/CopyLink'.
2022-12-24 16:39:34.902 INFO [ExtensionManager #0] Read extension metadata from '/home/louis/git/ts/extraterm/extensions/DefaultKeybindings'.
2022-12-24 16:39:34.903 INFO [ExtensionManager #0] Read extension metadata from '/home/louis/git/ts/extraterm/extensions/DefaultTerminalTheme'.
2022-12-24 16:39:34.903 INFO [ExtensionManager #0] Read extension metadata from '/home/louis/git/ts/extraterm/extensions/DirectoryCommands'.
2022-12-24 16:39:34.903 INFO [ExtensionManager #0] Read extension metadata from '/home/louis/git/ts/extraterm/extensions/DownloadBlock'.
2022-12-24 16:39:34.904 INFO [ExtensionManager #0] Read extension metadata from '/home/louis/git/ts/extraterm/extensions/Find'.
2022-12-24 16:39:34.905 INFO [ExtensionManager #0] Read extension metadata from '/home/louis/git/ts/extraterm/extensions/ITermColorsTerminalThemeProvider'.
2022-12-24 16:39:34.905 INFO [ExtensionManager #0] Read extension metadata from '/home/louis/git/ts/extraterm/extensions/ImageBlock'.
2022-12-24 16:39:34.906 INFO [ExtensionManager #0] Read extension metadata from '/home/louis/git/ts/extraterm/extensions/InjectShellIntegration'.
2022-12-24 16:39:34.907 INFO [ExtensionManager #0] Read extension metadata from '/home/louis/git/ts/extraterm/extensions/InsertEmoji'.
2022-12-24 16:39:34.909 INFO [ExtensionManager #0] Read extension metadata from '/home/louis/git/ts/extraterm/extensions/InternalCommands'.
2022-12-24 16:39:34.909 INFO [ExtensionManager #0] Read extension metadata from '/home/louis/git/ts/extraterm/extensions/OpenLink'.
2022-12-24 16:39:34.910 INFO [ExtensionManager #0] Read extension metadata from '/home/louis/git/ts/extraterm/extensions/ProxySessionBackend'.
2022-12-24 16:39:34.910 INFO [ExtensionManager #0] Read extension metadata from '/home/louis/git/ts/extraterm/extensions/ProxySessionEditor'.
2022-12-24 16:39:34.910 INFO [ExtensionManager #0] Read extension metadata from '/home/louis/git/ts/extraterm/extensions/StyleGuide'.
2022-12-24 16:39:34.911 INFO [ExtensionManager #0] Read extension metadata from '/home/louis/git/ts/extraterm/extensions/TLDRPages'.
2022-12-24 16:39:34.912 INFO [ExtensionManager #0] Read extension metadata from '/home/louis/git/ts/extraterm/extensions/TerminalTitle'.
2022-12-24 16:39:34.912 INFO [ExtensionManager #0] Read extension metadata from '/home/louis/git/ts/extraterm/extensions/Tips'.
2022-12-24 16:39:34.912 INFO [ExtensionManager #0] Read extension metadata from '/home/louis/git/ts/extraterm/extensions/UnixSessionBackend'.
2022-12-24 16:39:34.912 INFO [ExtensionManager #0] Read extension metadata from '/home/louis/git/ts/extraterm/extensions/UnixSessionEditor'.
2022-12-24 16:39:34.913 INFO [ExtensionManager #0] Read extension metadata from '/home/louis/git/ts/extraterm/extensions/WindowsConsoleSessionBackend'.
2022-12-24 16:39:34.913 INFO [ExtensionManager #0] Read extension metadata from '/home/louis/git/ts/extraterm/extensions/WindowsConsoleSessionEditor'.
2022-12-24 16:39:34.913 INFO [ExtensionManager #0] Starting extension 'about'
2022-12-24 16:39:34.917 INFO [ExtensionManager #0] Starting extension 'autocomplete'
2022-12-24 16:39:34.919 INFO [ExtensionManager #0] Starting extension 'autolink'
2022-12-24 16:39:34.919 INFO [ExtensionManager #0] Starting extension 'colorizer'
2022-12-24 16:39:34.923 INFO [ExtensionManager #0] Starting extension 'community-terminal-themes'
2022-12-24 16:39:34.924 INFO [ExtensionManager #0] Starting extension 'copy-block'
2022-12-24 16:39:34.926 INFO [ExtensionManager #0] Starting extension 'copy-link'
2022-12-24 16:39:34.926 INFO [ExtensionManager #0] Starting extension 'default-keybindings'
2022-12-24 16:39:34.926 INFO [ExtensionManager #0] Starting extension 'default-terminal-theme'
2022-12-24 16:39:34.926 INFO [ExtensionManager #0] Starting extension 'directory-commands'
2022-12-24 16:39:34.927 INFO [ExtensionManager #0] Starting extension 'download-block'
2022-12-24 16:39:34.935 INFO [ExtensionManager #0] Starting extension 'find'
2022-12-24 16:39:34.937 INFO [ExtensionManager #0] Starting extension 'itermcolors-terminal-theme-provider'
2022-12-24 16:39:34.942 DEBUG [itermcolors-terminal-theme-provider] ITermColorTerminalThemeProvider activating
2022-12-24 16:39:34.942 INFO [ExtensionManager #0] Starting extension 'image-block'
2022-12-24 16:39:34.945 INFO [ExtensionManager #0] Starting extension 'inject-shell-integration'
2022-12-24 16:39:34.945 INFO [ExtensionManager #0] Starting extension 'insert-emoji'
2022-12-24 16:39:34.949 INFO [ExtensionManager #0] Starting extension 'internal-commands'
2022-12-24 16:39:34.949 INFO [ExtensionManager #0] Starting extension 'open-link'
2022-12-24 16:39:34.949 INFO [ExtensionManager #0] Starting extension 'styleguide'
2022-12-24 16:39:34.950 WARN [ExtensionManager #0] Unable to load /home/louis/git/ts/extraterm/extensions/StyleGuide/dist/StyleGuideExtension.cjs. Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/home/louis/git/ts/extraterm/extensions/StyleGuide/dist/StyleGuideExtension.cjs' imported from /home/louis/git/ts/extraterm/main/dist/main.cjs
2022-12-24 16:39:34.950 INFO [ExtensionManager #0] Starting extension 'tldr-pages'
2022-12-24 16:39:34.951 INFO [ExtensionManager #0] Starting extension 'terminal-title'
2022-12-24 16:39:34.957 INFO [ExtensionManager #0] Starting extension 'tips'
2022-12-24 16:39:34.958 INFO [ExtensionManager #0] Starting extension 'unix-session-backend'
2022-12-24 16:39:34.980 INFO [ExtensionManager #0] Starting extension 'unix-session-editor'
2022-12-24 16:39:34.986 WARN [ConfigDatabase #0] Unable to find config for key  system
2022-12-24 16:39:35.020 INFO [LocalHttpServer #0] Local HTTP IPC server running on http://127.0.0.1:41405/32c06214dc2a7244d4c1cffc7fd36c0b

Above log is from stdout of yarn run run

Is 2022-12-24 16:39:34.950 WARN [ExtensionManager #0] Unable to load /home/louis/git/ts/extraterm/extensions/StyleGuide/dist/StyleGuideExtension.cjs. Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/home/louis/git/ts/extraterm/extensions/StyleGuide/dist/StyleGuideExtension.cjs' imported from /home/louis/git/ts/extraterm/main/dist/main.cjs an issue?

@sedwards2009
Copy link
Owner

That last bit shouldn't cause it to not start. Did you get a window at all? Did it have a hamburger menu in the top right corner?

@ldelossa
Copy link
Author

Nope, no UI window spawns at all, which is pretty odd.

I can do some debugging if youd like. Any hints?

@sedwards2009
Copy link
Owner

huh. 🤔 Maybe it did open, but off screen. You can try opening the extraterm.json (on Linux it is in ~/.config/extratermqt/extraterm.json) and either deleting it or just the windowConfiguration section. Run it again and see if that helps.

If you are up for some debugging, the most interesting file now is main/src/Window.ts, and line 702 (open()) and #moveOnScreen() below it. It get debug out this._log.debug(msg) will work. console.log() should also work, but it won't appear in the log file, just the terminal you launched from.

good luck

@ldelossa
Copy link
Author

Wiping out the config dir worked, and also no more crashes. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants