Skip to content
This repository has been archived by the owner on Jun 20, 2023. It is now read-only.

Strange lines in terminal #120

Closed
tjapro opened this issue Dec 8, 2016 · 21 comments · Fixed by atom/atom#20393
Closed

Strange lines in terminal #120

tjapro opened this issue Dec 8, 2016 · 21 comments · Fixed by atom/atom#20393

Comments

@tjapro
Copy link

tjapro commented Dec 8, 2016

Hello !

In lastest Atom I have got this lines in terminal:

bash: module: line 1: syntax error: unexpected end of file
bash: error importing function definition for `BASH_FUNC_module'
bash: scl: line 1: syntax error: unexpected end of file
bash: error importing function definition for `BASH_FUNC_scl'
/bin/sh: scl: line 1: syntax error: unexpected end of file
/bin/sh: error importing function definition for `BASH_FUNC_scl'
/bin/sh: module: line 1: syntax error: unexpected end of file
/bin/sh: error importing function definition for `BASH_FUNC_module'
/bin/sh: scl: line 1: syntax error: unexpected end of file
/bin/sh: error importing function definition for `BASH_FUNC_scl'
/bin/sh: module: line 1: syntax error: unexpected end of file
/bin/sh: error importing function definition for `BASH_FUNC_module'
/bin/sh: scl: line 1: syntax error: unexpected end of file
/bin/sh: error importing function definition for `BASH_FUNC_scl'
/bin/sh: module: line 1: syntax error: unexpected end of file
/bin/sh: error importing function definition for `BASH_FUNC_module' 

What is this?
OS: Fedora 25

@FossPrime
Copy link

Also using Fedora 25 on an Intel NUC Skull Canyon

bash: module: line 1: syntax error: unexpected end of file
bash: error importing function definition for `BASH_FUNC_module'
bash: scl: line 1: syntax error: unexpected end of file
bash: error importing function definition for `BASH_FUNC_scl'
/bin/sh: scl: line 1: syntax error: unexpected end of file
/bin/sh: error importing function definition for `BASH_FUNC_scl'
/bin/sh: module: line 1: syntax error: unexpected end of file
/bin/sh: error importing function definition for `BASH_FUNC_module'
/bin/sh: scl: line 1: syntax error: unexpected end of file
/bin/sh: error importing function definition for `BASH_FUNC_scl'
/bin/sh: module: line 1: syntax error: unexpected end of file
/bin/sh: error importing function definition for `BASH_FUNC_module'
/bin/sh: scl: line 1: syntax error: unexpected end of file
/bin/sh: error importing function definition for `BASH_FUNC_scl'
/bin/sh: module: line 1: syntax error: unexpected end of file

/bin/sh: error importing function definition for `BASH_FUNC_module'
``

@FossPrime
Copy link

can't reproduce this outside of atom... surprisingly, you can also trigger the same issue in gnome-terminal if you configure the karan/atom-terminal and open a terminal within Atom using the shortcuts

@tjapro
Copy link
Author

tjapro commented Dec 9, 2016

But is these strange console output an atom-core error? I ask this, because another package (git-control) have the same issue...

@FossPrime
Copy link

This is definitely an atom core error... is there a way to replicate this in safe mode?

@tjapro
Copy link
Author

tjapro commented Dec 10, 2016 via email

@tjapro
Copy link
Author

tjapro commented Dec 14, 2016

Hello.
In safe mode, atom doesn't allow initialize any plugin...
More, this bug still occur in the latest version of the atom.
I'm going open a new issue in atom-core...

@tjapro tjapro mentioned this issue Dec 14, 2016
6 tasks
@tjapro
Copy link
Author

tjapro commented Dec 26, 2016

Please see atom/atom#13451 (comment).
Thanks

@janpipek
Copy link

Hi, I've battled with the same issue for hours in Fedora 24. I don't understand how bash function export works and average-level googling did not help a lot. Besides, I need the "module" command to work so the typical solution "uninstall environment-modules" is no option for me.

Strangely enough, I found that if I start atom from the (bash) terminal, the messages are gone. So I bypassed the error by creating a script...

#!/bin/bash
/usr/bin/atom

... and updating the Atom shortcut (in my KDE menu, gnome should be similar) to use this script. This perhaps forces some bash magic I don't understand. But voila, I am done :-)

@tjapro
Copy link
Author

tjapro commented Jan 24, 2017 via email

@tjapro
Copy link
Author

tjapro commented Jan 24, 2017

When I got the .desktop file, I find this:

[Desktop Entry]
Name=Atom
Comment=A hackable text editor for the 21st Century.
GenericName=Text Editor
Exec=/usr/share/atom/atom %F
Icon=atom
Type=Application
StartupNotify=true
Categories=GNOME;GTK;Utility;TextEditor;Development;
MimeType=text/plain;

Seems atom starts from a different location than /usr/bin/atom.
I ckecked with the console.
I've got the strange output that I haven't with /usr/bin/atom.
And more: I've got also this console output (if helps to resolve the problem):

$ /usr/share/atom/atom
bash: cannot set terminal process group (-1): Inappropriate ioctl for device
bash: no job control in this shell

@janpipek
Copy link

Well, the /usr/bin/atom already does the necessary bash setup. So just change the desktop file and you're done. Easier than my previous solution. Thanks.

@tjapro
Copy link
Author

tjapro commented Jan 25, 2017 via email

@alex94cp
Copy link

What's the status on this? I still get this error as of Atom 1.17

@samuelzyx
Copy link

Based on @TJProgrammer's comments, just changing /usr/share/atom/atom to /usr/bin/atom in the .desktop file would solve the problem for Fedora. Can this be done?

@alex94cp
Copy link

Just for the record, this issue is not exclusive to this package, it is reproducible also in atom core (see my comment here).

@FossPrime
Copy link

@samuelzyx Funny you should ask. atom/atom#17508 (comment)

The reason this has taken so long is that it was hard to reproduce without plugins. Strangely, the issue stopped happening for me on platformio-atom-ide-terminal on Fedora 28, but still happens on the github package. It used to happen every time I opened a terminal inside atom.

@the-j0k3r
Copy link
Collaborator

the-j0k3r commented Feb 7, 2019

Please retest again with platformio-atom-ide-terminal 2.9.0 which since f64888d is using node-pty-prebuilt instead unmaintained and outdated pty.js. This is good news for stability and compatibility.

if issues persist, please open a new ticket with requested information.

Thx =)

@the-j0k3r the-j0k3r pinned this issue Feb 7, 2019
@tjapro
Copy link
Author

tjapro commented Feb 11, 2019

Thanks. Now there isn't no strange output!

@the-j0k3r
Copy link
Collaborator

@TJProgrammer thank you for the follow up =)

@the-j0k3r the-j0k3r unpinned this issue Jun 19, 2019
@djnotes
Copy link

djnotes commented Oct 21, 2019

Still I am getting this error on Fedora 31.

@platformio platformio locked as resolved and limited conversation to collaborators Oct 22, 2019
@the-j0k3r
Copy link
Collaborator

@djnotes

Thank you for reaching out with this bug report. Please see #120 (comment) and also try to export your paths to your ~/.bash_profile

For solution read #120 (comment) and solution on #120 (comment)

This is an external issue to this project and was fixed upstream in https://github.com/atom/atom/pull/17508/files

  • When this was reported it was much older versions of Atom and platformio-ide terminal therefore its an obsolete ticket.
  • Does not have any information new or otherwise required to be able to duplicate. Info like the required fields in the issue template.
  • The issue is not related to this project.

Thank you for your understanding.

xdelaruelle added a commit to xdelaruelle/atom that referenced this issue Feb 8, 2020
`getEnvFromShell` function calls `env` command through shell to get all
defined environment variable. However `env` also returns the shell
function defined with their whole code written on multiple lines.

Such shell function definitions were not properly handled by
`getEnvFromShell` which led to the following kind of error messages
(seen for instance when running a terminal package in Atom):

  bash: module: line 1: syntax error: unexpected end of file
  bash: error importing function definition for `BASH_FUNC_module'

With this change `getEnvFromShell` now skips shell function definition
to guarantee only environment variables are recorded and a sane `result`
array is returned.

Fixes atom#20389
Fixes atom#17369
Fixes atom#13451
Fixes blueimp/atom-open-terminal-here#27
Fixes blueimp/atom-open-terminal-here#18
Fixes bus-stop/Termination#101
Fixes bus-stop/terminus#24
Fixes platformio/platformio-atom-ide-terminal#120
Fixes platformio/platformio-atom-ide-terminal#293
Fixes AtomLinter/linter-pylint#243
Fixes AtomLinter/linter-flake8#643
Fixes AtomLinter/linter-flake8#165
Fixes AtomLinter/linter-flake8#422
Fixes AtomLinter/linter-puppet-lint#68
Fixes autocomplete-python/autocomplete-python#347
xdelaruelle added a commit to xdelaruelle/atom that referenced this issue Feb 8, 2020
`getEnvFromShell` function calls `env` command through shell to get all
defined environment variable. However `env` also returns the shell
function defined with their whole code written on multiple lines.

Such shell function definitions were not properly handled by
`getEnvFromShell` which led to the following kind of error messages
(seen for instance when running a terminal package in Atom):

  bash: module: line 1: syntax error: unexpected end of file
  bash: error importing function definition for `BASH_FUNC_module'

With this change `getEnvFromShell` now skips shell function definition
to guarantee only environment variables are recorded and a sane `result`
array is returned.

Fixes atom#20389
Fixes atom#17369
Fixes atom#13451
Fixes blueimp/atom-open-terminal-here#27
Fixes blueimp/atom-open-terminal-here#18
Fixes bus-stop/Termination#101
Fixes bus-stop/terminus#24
Fixes platformio/platformio-atom-ide-terminal#120
Fixes platformio/platformio-atom-ide-terminal#293
Fixes AtomLinter/linter-pylint#243
Fixes AtomLinter/linter-flake8#643
Fixes AtomLinter/linter-flake8#165
Fixes AtomLinter/linter-flake8#422
Fixes AtomLinter/linter-puppet-lint#68
Fixes autocomplete-python/autocomplete-python#347
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants