Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Aug 30, 2024. It is now read-only.
/coder-v1-cliPublic archive

fix: Force bash for non-standard flags to exec#226

Merged
jawnsy merged 1 commit intomasterfromjawnsy/ch418
Jan 25, 2021
Merged

Conversation

jawnsy
Copy link
Contributor

@jawnsyjawnsy commentedJan 24, 2021
edited
Loading

This addresses a regression introduced by#224. POSIXsh does not define arguments to theexec built-in, resulting in an error when usingexec -a to set the process name (argv[0]).

This change executes/bin/bash instead ofsh, and also changes to useexec -l, which automatically handles the hyphen prefix required to trigger login shell behavior.

This also explicitly runs/bin/sh, aligning the behavior ofcoder sh and the frontend Terminal application.

Tested this using Arch Linux (enterprise-dev image) as well as the base Debian image from DockerHub.

[coder@jawnsy-m coder-cli]$go install ./cmd/coder[coder@jawnsy-m coder-cli]$which coder/home/coder/go/bin/coder[coder@jawnsy-m coder-cli]$coder sh jawnsy-mwarning: version mismatch detected  | Coder CLI version: unknown  | Coder API version: 1.14.0+340-gd64a44cb3-20210123  |  | tip: download the appropriate version here: https://github.com/cdr/coder-cli/releases[coder@jawnsy-m ~]$shopt login_shelllogin_shell     on[coder@jawnsy-m ~]$exitlogout[coder@jawnsy-m coder-cli]$coder sh jawnsy-debianwarning: version mismatch detected  | Coder CLI version: unknown  | Coder API version: 1.14.0+340-gd64a44cb3-20210123  |  | tip: download the appropriate version here: https://github.com/cdr/coder-cli/releasesroot@jawnsy-debian:~#shopt login_shelllogin_shell     onroot@jawnsy-debian:~#exitlogout

This addresses a regression introduced by#224. POSIX sh does notdefine arguments to the exec built-in, resulting in an error whenusing 'exec -a' to set the process name (argv[0]).This change executes /bin/bash instead of sh, and also changesto use 'exec -l', which automatically handles the hyphen prefixrequired to trigger login shell behavior.This also explicitly runs /bin/sh, aligning the behavior of"coder sh" and the frontend Terminal application.
@shortcut-integration
Copy link

This pull request has been linked toClubhouse Story #418: Use a login shell for terminals.

@jawnsyjawnsy self-assigned thisJan 24, 2021
@jawnsyjawnsy mentioned this pull requestJan 24, 2021
@jawnsyjawnsy merged commit51fd2d3 intomasterJan 25, 2021
@jawnsyjawnsy deleted the jawnsy/ch418 branchJanuary 25, 2021 15:45
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@tychoishtychoishtychoish approved these changes

@cmoogcmoogcmoog approved these changes

@kylecarbskylecarbsAwaiting requested review from kylecarbs

Assignees

@jawnsyjawnsy

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@jawnsy@tychoish@cmoog

[8]ページ先頭

©2009-2025 Movatter.jp