Skip to content

fix(terminal): use window.location to work when served NOT on root path #5332

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

Merged
merged 1 commit into from
Jul 14, 2022

Conversation

jsjoeio
Copy link
Contributor

@jsjoeio jsjoeio commented Jul 11, 2022

Description

We made a change in workbench-dev.html but forgot to make it in workbench.html. This fixes the Integrated Terminal to work when code-server is served NOT on the root path (i.e. accessed at /vscode instead of /).

Fixes #5321

@jsjoeio jsjoeio self-assigned this Jul 11, 2022
@github-actions
Copy link

github-actions bot commented Jul 11, 2022

✨ code-server docs for PR #5332 is ready! It will be updated on every commit.

@jsjoeio jsjoeio added the bug Something isn't working label Jul 11, 2022
@codecov
Copy link

codecov bot commented Jul 11, 2022

Codecov Report

Merging #5332 (eadad9f) into main (9ad0d9e) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #5332   +/-   ##
=======================================
  Coverage   72.47%   72.47%           
=======================================
  Files          30       30           
  Lines        1671     1671           
  Branches      367      367           
=======================================
  Hits         1211     1211           
  Misses        397      397           
  Partials       63       63           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9ad0d9e...eadad9f. Read the comment docs.

@jsjoeio jsjoeio temporarily deployed to npm July 11, 2022 23:33 Inactive
@github-actions
Copy link

github-actions bot commented Jul 11, 2022

✨ code-server dev build published to npm for PR #5332!

  • Last publish status: success
  • Commit: eadad9f

To install in a local project, run:

npm install @coder/code-server-pr@5332

To install globally, run:

npm install -g @coder/code-server-pr@5332

@jsjoeio jsjoeio force-pushed the jsjoeio/fix-terminal branch from 0e5df64 to 2b339bc Compare July 13, 2022 23:49
When using `window.location.origin` to create a new URL for loading
web packages, it constructs a URL that is not relative, leading to the
terminal breaking when code-server is served not via the root (i.e. /ide
instead of /).
@jsjoeio jsjoeio force-pushed the jsjoeio/fix-terminal branch from 2b339bc to eadad9f Compare July 13, 2022 23:52
@jsjoeio jsjoeio changed the title wip: fix terminal fix(terminal): use window.location to work when served NOT on root path Jul 13, 2022
Copy link

@oxy oxy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1!

@jsjoeio jsjoeio marked this pull request as ready for review July 13, 2022 23:57
@jsjoeio jsjoeio requested a review from a team July 13, 2022 23:57
@jsjoeio jsjoeio temporarily deployed to npm July 14, 2022 00:08 Inactive
Copy link
Member

@code-asher code-asher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oof, nice catch.

@jsjoeio
Copy link
Contributor Author

jsjoeio commented Jul 14, 2022

Tested this locally behind Caddy and it worked 🎉

  1. yarn init -y
  2. yarn add @coder/code-server-pr@5332
  3. yarn code-server --auth none
  4. caddy run with this:
http://localhost:8082/ide/* {
  uri strip_prefix /ide
  reverse_proxy 127.0.0.1:8080
}

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: terminal not working when your web base_path is not /
3 participants