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

Integrated Terminal Breaks when Running Large Sections of Selected Text #68932

Closed
diazdc opened this issue Feb 18, 2019 · 1 comment
Closed
Labels
*duplicate Issue identified as a duplicate of another issue(s)

Comments

@diazdc
Copy link

diazdc commented Feb 18, 2019

  • VSCode Version: 1.3.1
  • OS Version: Mac OS Mojave

Steps to Reproduce:

  1. Running larger blocks (approximately 30+ lines) of selected text in integrated terminal using "Terminal: Run Selected Text in Active Terminal" will repeat, omit, or reorganize the original input. I've encountered this problem with a clean install of vs code in both R and python scripts.

For example, if I select and run the R script below:

library(datasets)
data(iris)
library(dplyr)

summary(iris)
names(iris) <- tolower(names(iris))

# filter() the data for species virginica
virginica <- filter(iris, species == "virginica")
head(virginica) # This dispalys the first six rows

# select() the specified columns
selected <- select(iris, sepal.length, sepal.width, petal.length)
# select all columns from sepal.length to petal.length
selected2 <- select(iris, sepal.length:petal.length)
head(selected, 3)

# selected and selected2 are exactly the same
identical(selected, selected2)
# create a new column that stores logical values for sepal.width greater than half of sepal.length
newCol <- mutate(iris, greater.half = sepal.width > 0.5 * sepal.length)
tail(newCol)

# arrange()
newCol <- arrange(newCol, petal.width)
head(newCol)

# The chain operator, or the pipeline %>%
# This will first filter, and then arrange our data. Note that here the order in which you call functions does not matter, but in other cases it might
arr.virg <- newCol %>% filter(species == "virginica") %>% arrange(sepal.width)
arr.virg[30:35,] # will show us rows 30 through 35 and all columns

# You can also arrange in descending order using desc() on what you arrange by
# arrange(desc(sepal.width))
# summarise()
summarise(arr.virg, mean.length = mean(sepal.length, na.rm = TRUE))

I get the following output:

> # The chain operator, or the pipeline %>%
> # This will first filter, and then arrange our data. Note that here the order in which you call functions does not matter, but in other cases it might
> arr.virg <- newCol %>% filter(species arr.virg <- ne) %>% arrange(sepal.width)
Error: unexpected symbol in "arr.virg <- newCol %>% filter(species arr.virg"
> arr.arr.arr.35,] #arr.arr.arr.35,] #arr.arr.arr.35,]nd arr.arr.arr.35,] #arr.arr.arr.35,] #ar desarr.arr.arr.35,] #arr.arr.arr.35,] #arr.arrnge by
Error: unexpected ',' in "arr.arr.arr.35,"
> # arrange(desc(sepal.width))
> # summarise()
> summarisesummarisesummarisesummarisean(sepal.length, na.rm = TRUE))
Error: unexpected ')' in "summarisesummarisesummarisesummarisean(sepal.length, na.rm = TRUE))"

It looks like the amount of text sent starts to break after this comment:

# This will first filter, and then arrange our data. Note that here the order in which you call functions does not matter, but in other cases it might

What's interesting is that if I delete four lines of comments, code, or empty lines, the problem goes away. It seems as though there's a limit to the amount of text that can be sent using "Terminal: Run Selected Text in Active Terminal". As a data scientist, this is a feature that is critical to my workflow, as I run a lot of code interactively. Other text editors (Sublime Text, R Studio, Spyder) seem to handle this feature very nicely, however, the allure of VS code is providing a single feature rich environment for data science, as opposed to using different text editors/IDEs for different languages. I would really like VS code to be my first choice. Thank you for your time.

Does this issue occur when all extensions are disabled?: Yes

@Tyriar
Copy link
Member

Tyriar commented Feb 18, 2019

#38137

@Tyriar Tyriar closed this as completed Feb 18, 2019
@Tyriar Tyriar added the *duplicate Issue identified as a duplicate of another issue(s) label Feb 18, 2019
@vscodebot vscodebot bot locked and limited conversation to collaborators Apr 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*duplicate Issue identified as a duplicate of another issue(s)
Projects
None yet
Development

No branches or pull requests

2 participants