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

Broken workflow with 1.19 update #40264

Closed
agauniyal opened this issue Dec 15, 2017 · 5 comments
Closed

Broken workflow with 1.19 update #40264

agauniyal opened this issue Dec 15, 2017 · 5 comments
Assignees
Labels
*as-designed Described behavior is as designed workbench-state UI state across restarts

Comments

@agauniyal
Copy link

  • VSCode Version: 1.19
  • OS Version: Arch Linux

Steps to Reproduce:

  1. cd someFolder && code . vscode will be opened with current folder as root
  2. use dmenu to launch vscode. It will open up empty file(code-stdin-xxx) in tmp folder.

Previously it used to open last opened folder (ie someFolder) as root folder in the current instance too.

Reproduces without extensions: Yes

https://wiki.archlinux.org/index.php/Dmenu

@vscodebot vscodebot bot added workbench workbench-state UI state across restarts labels Dec 15, 2017
@bpasero
Copy link
Member

bpasero commented Dec 15, 2017

@agauniyal make sure that dmenu is not launching our CLI script but the actual Code binary. Then it should be fine.

@bpasero bpasero closed this as completed Dec 15, 2017
@bpasero bpasero added the *as-designed Described behavior is as designed label Dec 15, 2017
@agauniyal
Copy link
Author

@bpasero can you help me out with that 😅 -

cat /usr/bin/code 
#!/usr/bin/env bash
#
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.

# If root, ensure that --user-data-dir is specified
if [ "$(id -u)" = "0" ]; then
	for i in $@
	do
		if [[ $i == --user-data-dir=* ]]; then
			DATA_DIR_SET=1
		fi
	done
	if [ -z $DATA_DIR_SET ]; then
		echo "You are trying to start vscode as a super user which is not recommended. If you really want to, you must specify an alternate user data directory using the --user-data-dir argument." 1>&2
		exit 1
	fi
fi

if [ ! -L $0 ]; then
	# if path is not a symlink, find relatively
	VSCODE_PATH="$(dirname $0)/.."
else
	if which readlink >/dev/null; then
		# if readlink exists, follow the symlink and find relatively
		VSCODE_PATH="$(dirname $(readlink -f $0))/.."
	else
		# else use the standard install location
		VSCODE_PATH="/usr/share/code"
	fi
fi

ELECTRON="$VSCODE_PATH/code"
CLI="$VSCODE_PATH/resources/app/out/cli.js"
ELECTRON_RUN_AS_NODE=1 "$ELECTRON" "$CLI" "$@"
exit $?

@dcelasun
Copy link

I'm the maintainer of the Arch package and this is an already fixed packaging issue, it shouldn't have been reported here.

@bpasero
Copy link
Member

bpasero commented Dec 15, 2017

@dcelasun great

For anyone else hitting this issue, make sure to execute the Code binary directly and not the code.sh terminal script which is only intended to be called from a real terminal.

On Ubuntu for example the binary is: /usr/share/code/code

@crumblingstatue
Copy link

Is there any reason code.sh could not detect when it's running in a tty, and not try to open stdin when it's not in a tty?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*as-designed Described behavior is as designed workbench-state UI state across restarts
Projects
None yet
Development

No branches or pull requests

4 participants