Command in atom terminal giving different results than command prompt - powershell

I'm attempting to create a file from my an embedded terminal in my text editor, Atom. The terminal is from the package "platformio-ide-terminal"
When I run a command to create a file in windows command prompt, I am able to create a file without issue, however, when I run the exact same code in my terminal thats embedded in atom it doesn't work.
The command that I'm running is type nul > lecture3.md since I'm trying to create a markdown file. As previously mentioned, this works fine in command prompt, but when I run it in my terminal in atom it seems to interpret the command like I'm trying to enter a folder called "nul", which obviously doesn't exist. The error that's being displayed is as follows:
At line:1 char:1
+ type nul > lecture3.md
+ ~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (pathtocurrentfolder\nul:String) [Get-Content], ItemNotFoundException
+ FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetContentCommand
I would like to know why this error is happening from my terminal in atom, and not in command prompt, and how I can rectify this issue.

I had a similar exception working on visual code. Most IDE have costume handling exceptions. Probably the IDE is trying to check if nul exist even thou the terminal is passing the command just fine.
I received a similar message on Visual Code for type nul > "yourfile.txt":
> type : Cannot find path 'C:\nul' because it does not exist.
At line:1 char:1
+ type nul > "yourfile.txt"
+ ~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (C:\nul:String) [Get-Content], ItemNotFoundException
+ FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetContentCommand
Even that I got the error the command worked and the file was created. You could check the folder to confirm the creation of the file from the terminal inside de IDE with the dir command if your working directory is set on the directory where you created the file.

Related

Hello world programme is not executing

PS C:\Users\PARKHAR AGARWAL\Desktop> cd "JavaProgramming.java" //written by me in terminal.
cd : Cannot find path 'JavaProgramming.java' because it does not exist. // error
At line:1 char:1
+ cd "JavaProgramming.java"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (JavaProgramming.java:String) [Set-Location], ItemNotFoundException
+ FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.SetLocationCommand
// what should i do now because i have checked that my file is present in desktop.
I m not getting Hello world as a output.
You cannot run JavaProgramming.java with CD.
Files with .java extensions are not compiled programs. You need, first of all, to compile it with some compiler, like javac. It will generate a .jar file.
After that, you can use the java command in the terminal to run this program. Example: java ./JavaProgramming.jar

error in executing lua code in vscode powershell terminal

i normally execute my lua files in the terminal with lua file-name.lua. i recently found out that you could also execute the code from terminal using lua53 .\file_name.lua where the lua version was 5.3
the lua version that im using is 5.1 so i entered lua51 .\file_name.lua on my terminal but i was given this error instead
lua51 : The term 'lua51' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the
name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ lua51 .\main.lua
+ ~~~~~
+ CategoryInfo : ObjectNotFound: (lua51:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
the lua version that im using is 5.1 so i entered
lua51 .\file_name.lua
on my terminal but i was given this error instead
try to write this
lua5.1 .\file_name.lua

Why do I have a terminal error in VS Code?

I'm trying to learn Python using VS Code. Onde of my task is to opne a file from folder in VS Code nad then run a terminal but when I'm opening it i have error like below in temrinal
PS C:\Users\Łukasz\Desktop\Exercise Files> & C:/Users/ukasz/AppData/Local/Programs/Python/Python39/python.exe "c:/Users/ukasz/Desktop/Exercise Files/Chap02/02_07_begin.py"
& : The term 'C:/Users/ukasz/AppData/Local/Programs/Python/Python39/python.exe' is not recognized as the name of a cmdlet, function, script file, or operable progra
m. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:3
+ & C:/Users/ukasz/AppData/Local/Programs/Python/Python39/python.exe "c ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (C:/Users/ukasz/...on39/python.exe:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
PS C:\Users\Łukasz\Desktop\Exercise Files>
Could you explain me what I'm doing wrong? I'm not sure what's wrong in the file path and what I can change. I was just adding a file from my desktop, and also just installing a Python on my computer, nothing more.
If it help - I'm learning from the Linkedin Learnign, so I'm just trying to do what they say ;)

Atom platformio won't run python

I am having trouble getting my atom set up as an IDE. The platformio-ide-terminal package wont run python. I have a simple file called myfile.py which prints a sentence. My working directory is in documents in a fodder I've created for a course I'm using atom for.I get the following error message in my command line in atom:
PS C:\Users\Angus\Documents\UdemyPython_10Apps\Beyond_Basics> python3 myfile.pypython3 : The term 'python3' is not recognized as the name of a cmdlet, function, script file, oroperable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ python3 myfile.py3
+ ~~~~~~~
+ CategoryInfo : ObjectNotFound: (python3:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Some windows terminals accept py -3 instead of python3 as the proper alias, the command to open and run python programs.

All commands failing in powershell (4.0.) Even "c:" and "cd" and "dir"

I'm not sure when this started... whenever I open PowerShell, I can't execute even the most basic commands. I always get the following error message:
PS C:\> dir
dir : Cannot find drive. A drive with the name '.' does not exist.
At line:1 char:1
+ dir
+ ~~~
+ CategoryInfo : ObjectNotFound: (.:String) [], DriveNotFoundException
+ FullyQualifiedErrorId : DriveNotFound
---
This had been working fine but now all of a sudden I can't do anything. I've tried removing PowerShell 4 and re-installing... no change. Sorry for the formatting here... It looks organized in my view above but the preview text looks horrid.
I don't remember ever having java installed, but looking at my regular %path% I see that %java_home% is in there, but the value is never used or defined anywhere. Once I removed that from my path, the error above went away.
Strange that it would even be an issue for powershell. You'd think it would just skip past a non-existent directory in my path and move onto the next one when resolving a command.