question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Terminal keeps starting with `sh` instead of `bash`

See original GitHub issue

Hi,

Every time I open a new terminal, it uses the sh instead of bash (which is what I have selected as shell. I am using Ubuntu 17.04

The following error is shown in the developer tools, though it does not seem to be directly related:

errors.ts:42 ERROR Error: Uncaught (in promise): TypeError: Cannot read property 'recoveryId' of null
TypeError: Cannot read property 'recoveryId' of null
    at TerminalTabComponent.getRecoveryToken (/opt/Terminus/resources/builtin-plugins/terminus-terminal/dist/index.js:271:44)
    at window.localStorage.tabsRecovery.JSON.stringify.tabs.map (/opt/Terminus/resources/builtin-plugins/terminus-core/dist/index.js:2975:31)
    at Array.map (native)
    at TabRecoveryService.saveTabs (/opt/Terminus/resources/builtin-plugins/terminus-core/dist/index.js:2975:14)
    at SafeSubscriber.TabRecoveryService.app.tabsChanged$.subscribe [as _next] (/opt/Terminus/resources/builtin-plugins/terminus-core/dist/index.js:2970:18)
    at SafeSubscriber.__tryOrUnsub (/opt/Terminus/resources/app.asar/node_modules/rxjs/Subscriber.js:236:16)
    at SafeSubscriber.next (/opt/Terminus/resources/app.asar/node_modules/rxjs/Subscriber.js:185:22)
    at Subscriber._next (/opt/Terminus/resources/app.asar/node_modules/rxjs/Subscriber.js:125:26)
    at Subscriber.next (/opt/Terminus/resources/app.asar/node_modules/rxjs/Subscriber.js:89:18)
    at Subject.next (/opt/Terminus/resources/app.asar/node_modules/rxjs/Subject.js:55:25)
    at TerminalTabComponent.getRecoveryToken (/opt/Terminus/resources/builtin-plugins/terminus-terminal/dist/index.js:271:44)
    at window.localStorage.tabsRecovery.JSON.stringify.tabs.map (/opt/Terminus/resources/builtin-plugins/terminus-core/dist/index.js:2975:31)
    at Array.map (native)
    at TabRecoveryService.saveTabs (/opt/Terminus/resources/builtin-plugins/terminus-core/dist/index.js:2975:14)
    at SafeSubscriber.TabRecoveryService.app.tabsChanged$.subscribe [as _next] (/opt/Terminus/resources/builtin-plugins/terminus-core/dist/index.js:2970:18)
    at SafeSubscriber.__tryOrUnsub (/opt/Terminus/resources/app.asar/node_modules/rxjs/Subscriber.js:236:16)
    at SafeSubscriber.next (/opt/Terminus/resources/app.asar/node_modules/rxjs/Subscriber.js:185:22)
    at Subscriber._next (/opt/Terminus/resources/app.asar/node_modules/rxjs/Subscriber.js:125:26)
    at Subscriber.next (/opt/Terminus/resources/app.asar/node_modules/rxjs/Subscriber.js:89:18)
    at Subject.next (/opt/Terminus/resources/app.asar/node_modules/rxjs/Subject.js:55:25)
    at resolvePromise (/opt/Terminus/resources/app.asar/node_modules/zone.js/dist/zone.js:770:31)
    at /opt/Terminus/resources/app.asar/node_modules/zone.js/dist/zone.js:696:17
    at fulfilled (/opt/Terminus/resources/builtin-plugins/terminus-terminal/dist/index.js:997:86)
    at ZoneDelegate.invoke (/opt/Terminus/resources/app.asar/node_modules/zone.js/dist/zone.js:391:26)
    at Object.onInvoke (/opt/Terminus/resources/app.asar/node_modules/@angular/core/bundles/core.umd.js:3922:33)
    at ZoneDelegate.invoke (/opt/Terminus/resources/app.asar/node_modules/zone.js/dist/zone.js:390:32)
    at Zone.run (/opt/Terminus/resources/app.asar/node_modules/zone.js/dist/zone.js:141:43)
    at /opt/Terminus/resources/app.asar/node_modules/zone.js/dist/zone.js:818:57
    at ZoneDelegate.invokeTask (/opt/Terminus/resources/app.asar/node_modules/zone.js/dist/zone.js:424:31)
    at Object.onInvokeTask (/opt/Terminus/resources/app.asar/node_modules/@angular/core/bundles/core.umd.js:3913:33)
defaultErrorLogger @ errors.ts:42

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:4
  • Comments:5

github_iconTop GitHub Comments

2reactions
JBlondcommented, Oct 25, 2017

Same on ubuntu 16.04 The error wasn’t there in alpha 34

0reactions
GabrielAncacommented, Dec 4, 2017

Hi, I could reproduce the issue in Ubuntu 16.04.

Another workaround for it is to go to Settings > Terminal > Shell > Custom and then write /bin/bash in the “Custom shell” textbox.

I have been browsing through the code, the error that @Vinno97 mentioned seems related though, but not the main cause. In the end that error caused because sessionOptions is null in this line: https://github.com/Eugeny/terminus/blob/0420b2dbb91f9729dec5250d148a83de12b5e14f/terminus-terminal/src/components/terminalTab.component.ts#L114

However, if I change the Custom shell to /bin/bash --login (which would be the same as if you select /bin/bash in the dropdown), then the error is gone and still the shell doesn’t work.

I hope this helps 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

How can I make a script that opens terminal windows and ...
Here's a contrived example, which opens up a single tab, titles it "test", then runs the simple command cd /etc; ls inside it....
Read more >
On restart terminal opens with sh rather than zsh #131294
If I then reopen the terminal, it'll start with zsh but SHELL=/bin/sh . If I then stop vscode, and start it again, the...
Read more >
How to use Bash for sh in Ubuntu - Unix Stack Exchange
To switch sh to bash (instead of dash , the default), reconfigure dash (yes, it's somewhat counter-intuitive): sudo dpkg-reconfigure dash.
Read more >
Switching from sh shell to bash shell as default terminal when ...
The last try - I opened .profile and put there SHELL= type -P bash exec bash -l which is described bellow and found...
Read more >
IDE opens terminal with bash when the default shell is zsh
'Preferences | Terminal' shows that the default shell is bash. The embedded Terminal is switched to zsh only after restart of your OSX...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found