How do I set the PS1 (prompt) macOS Monterey 12.6.2 - terminal

How do I set the PS1 (prompt) in terminal on my macbook pro using Monterey 12.6.2.
I am trying to have the prompt in terminal to display my current directory. In terminal and on the command line, I used PS1=\W and variations of that, but it is not working as it did in other version of the macOS.
I would like to see my prompt displaying my current working directory when I am using terminal.

Related

Open Mac Terminal, activate venv and leave the terminal windows running (.command file)

Using OSX, I want to create an easy shortcut to get a terminal that already has a venv initialized.
I tried creating a .command file with the following:
#!/bin/zsh
source /path/to/code/venv-python3.10/bin/activate
cd /path/to/code/my_project_directory/
zsh
I double-click the .command file within finder, and my objective is to start up a terminal with the correct venv initialised, so I can continue working in the terminal.
But without the zsh at the end, the terminal window auto-exits.
With the zsh, it remains open but does not leave me within the virtualenv.

How to change the default home directory in oh my zsh terminal?

I am working to install oh my zsh on my system and its working fine. The home directory is automatically set to what I need i.e. #( 08/05/21# 5:22PM )( asus#LAPTOP-DVFCDSAR ):/mnt/c/Users/asus
Initially it was in ~ directory. To change to the directory of my computer system I wrote export CDPATH=~/mnt/c/Users/asus in Windows Terminal set up to use Ubuntu from wsl.
But now when I set up Hyper Terminal to use oh my zsh, the default directory is still ~ which is /home/asus/. And now if I had to change to the directory I want, I need to cd to asus directory. How do I change this behaviour of hyper terminal to automatically use the above path to asus as default directory whenever I open hyper terminal?

How with wsl 2 open new ubuntu terminal from command line?

How can i open new ubuntu terminal windows or terminal subtab with terminal command?
I need to execute it from current opened ubuntu terminal
You should have programs from your Windows %PATH% available in your WSL $PATH, so you may be able to just use cmd.exe /c bash or similar
Alternatively, you could install an X server on Windows (like Xming) and run a terminal emulator like konsole or Terminator inside WSL

How do I run .scptd from Terminal in Mac?

I have a .sctd file in mac, i want to run it from terminal without opening the AppleScript Editor
You can use osascript to run apple scripts in the terminal.

png terminal not working gnuplot in OS X 10.8.4

I have started using gnuplot in my macbook pro. I am using OS X 10.8.4. Whenever I set terminal to png using
set term png
it gave an error as follow:
unknown or ambiguous terminal type; type just 'set terminal' for a list
Does somebody know it?

Resources